function getRequestURI() { global $config; $method = isset($_SERVER['REQUEST_METHOD']) && strtoupper($_SERVER['REQUEST_METHOD']) == 'GET'; if (empty($_SERVER['REQUEST_URI']) == false && $method == true) { $request_uri = ''; $var = parse_url($config['furl']); $request_uri = sprintf('http%s://%s%s', ini_isSecureHttp() ? 's' : '', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $var['host'], $_SERVER['REQUEST_URI']); if (check_hp($request_uri)) { $request_uri = preg_replace('~(\\?|&)s=[A-Za-z0-9]*~i', '', $request_uri); $url = parse_url($request_uri); if (empty($url['path'])) { $url['path'] = ''; } $file = basename($url['path']); if (!empty($loc) && file_exists($file) && $file != 'log.php' && $file != 'register.php') { if (strpos($loc, '?') === false) { $request_uri .= SID2URL_1; } else { $request_uri .= SID2URL_x; } } return $request_uri; } } return ''; }
function AddSid($content) { if (!empty($this->sid)) { $own_url = ini_isSecureHttp() ? 'https://' : 'http://'; $own_url = preg_quote($own_url.$_SERVER['HTTP_HOST'], '~'); $content = preg_replace_callback('~<a([^>]+?)href=("|\')('.$own_url.'(:\d*)?/?([a-zA-Z0-9\-\.:;_\?\,/\\\+&%\$#\=\~\[\]]*)?|([a-zA-Z0-9\-\._/\~]*)?[\w-]+?\.\w+?(\?[a-zA-Z0-9\-\.:;_\?\,/\\\+&%\$#\=\~\[\]]*)?)("|\')~i', array(&$this, 'ConstructLink'), $content); } return $content; }
function getFUrl() { // HTTP_HOST is having the correct browser url in most cases... $server_name = !empty($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : (!empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $https = ini_isSecureHttp() ? 'https://' : 'http://'; $source = !empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); if (!$source) { $source = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); } // Replace backslashes and doubled slashes (could happen on some proxy setups) $source = str_replace(array('\\', '//', '/install'), '/', $source); $source = trim(trim(dirname($source)), '/'); $furl = rtrim($https . $server_name . '/' . $source, '/'); return $furl; }
echo foot(); } elseif ($job == 'cron2') { echo head(); $c->getdata(); $c->updateconfig('pccron', int); $c->updateconfig('pccron_maxjobs', int); $c->updateconfig('pccron_uselog', int); $c->updateconfig('pccron_sendlog', int); $c->updateconfig('pccron_sendlog_email', str); $c->savedata(); ok('admin.php?action=settings&job=settings'); } elseif ($job == 'general') { echo head(); // HTTP_HOST is having the correct browser url in most cases... $server_name = !empty($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : (!empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $https = ini_isSecureHttp() ? 'https://' : 'http://'; $source = !empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); if (!$source) { $source = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); } // Replace backslashes and doubled slashes (could happen on some proxy setups) $source = str_replace(array('\\', '//', '/admin'), '/', $source); $source = trim(trim(dirname($source)), '/'); $furl = $https . $server_name . '/' . $source; if (!check_hp($furl)) { $furl = $lang->phrase('admin_unable_to_analyze_url'); } $fpath = str_replace('\\', '/', realpath('./')); ?> <form name="form" method="post" action="admin.php?action=settings&job=general2"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
function makecookie($name, $value = '', $expire = 31536000) { if (SCRIPTNAME == 'external') { return FALSE; } if ($expire != null) { $expire = time() + $expire; } else { $expire = 0; } setcookie($name, $value, $expire, null, null, ini_isSecureHttp()); }