diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-12-02 23:53:21 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-12-02 23:53:21 +0000 |
| commit | df3e7ab53276386a922f25cfbca09b01efed7446 (patch) | |
| tree | d740d52df7656cacb026e6f65070ecc304a83749 /phpBB/includes/functions.php | |
| parent | afd03ff1b86103653e914aa38251ea2581c59bc6 (diff) | |
| download | forums-df3e7ab53276386a922f25cfbca09b01efed7446.tar forums-df3e7ab53276386a922f25cfbca09b01efed7446.tar.gz forums-df3e7ab53276386a922f25cfbca09b01efed7446.tar.bz2 forums-df3e7ab53276386a922f25cfbca09b01efed7446.tar.xz forums-df3e7ab53276386a922f25cfbca09b01efed7446.zip | |
Redirect changes
git-svn-id: file:///svn/phpbb/trunk@3161 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 09cb5b365f..aefef930f2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -685,17 +685,25 @@ function obtain_word_list(&$orig_word, &$replacement_word) } // Redirects the user to another page then exits the script nicely -function redirect($location) +function redirect($url) { - global $db; + global $db, $config; if (isset($db)) { $db->sql_close(); } - $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . $location); + $protocol = ($config['cookie_secure']) ? 'https://' : 'http://'; + $server = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($config['server_name'])); + $path = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($config['script_path'])); + $port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/'; + + if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) + { + header('HTTP/1.0 302 Redirect'); + } + header('Location: ' . $protocol . $server . $path . $port . $url); exit; } @@ -1001,4 +1009,4 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } } -?> +?>
\ No newline at end of file |
