From f3ac2a922547f2325d52b7b3893cc5bc2df3b777 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Fri, 25 Nov 2005 10:18:49 +0000 Subject: [PATCH] - make PMA_sendHeaderLocation() earlier available - add SID only if set - check for url params already exist or not (wether & . SID or ? . SID) - respect arg_separator.input from php.ini --- ChangeLog | 5 +++ libraries/common.lib.php | 87 +++++++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26dfbaa8d3..8e42c8f497 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,11 @@ $Source$ 2005-11-24 Sebastian Mendel * libraries/url_generating.lib.php: do not htmlentities on whole string + * libraries/common.lib.php: + - make PMA_sendHeaderLocation() earlier available + - add SID only if set + - check for url params already exist or not (wether & . SID or ? . SID) + - respect arg_separator.input from php.ini 2005-11-25 Michal Čihař * Documentation.html, config.footer.inc.php(deleted), diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 22d48bf062..ffb252d718 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1091,6 +1091,58 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $rs, $userl if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { + + + /** + * Send HTTP header, taking IIS limits into account + * ( 600 seems ok) + * + * @param string the header to send + * + * @return boolean always true + */ + function PMA_sendHeaderLocation($uri) + { + if (PMA_IS_IIS && strlen($uri) > 600) { + + echo '- - -' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo ' ' . "\n"; + + } else { + $uri .= '?h=y'; + if ( true || SID ) { + if ( strpos( $uri, '?' ) === false ) { + header( 'Location: ' . $uri . '?' . SID ); + } else { + // use seperators defined by php, but prefer ';' + // as recommended by W3C + $php_arg_separator_input = ini_get( 'arg_separator.input' ); + if ( strpos( $php_arg_separator_input, ';' ) !== false ) { + $separator = ';'; + } elseif ( strlen( $php_arg_separator_input ) > 0 ) { + $separator = $php_arg_separator_input{0}; + } else { + $separator = '&'; + } + exit; + header( 'Location: ' . $uri . $separator . SID ); + } + } else { + header( 'Location: ' . $uri ); + } + } + } + + /** * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be * set properly and, depending on browsers, inserting or updating a @@ -1444,36 +1496,6 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { } // end server connecting - /** - * Send HTTP header, taking IIS limits into account - * ( 600 seems ok) - * - * @param string the header to send - * - * @return boolean always true - */ - function PMA_sendHeaderLocation($uri) - { - if (PMA_IS_IIS && strlen($uri) > 600) { - - echo '- - -' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo ' ' . "\n"; - - } else { - header( 'Location: ' . $uri . '&' . SID ); - } - } - - /** * Get the list and number of available databases. * @@ -2582,9 +2604,9 @@ window.parent.updateTableTitle( '', ' (FAQ 2.8)
'; $found_error = TRUE; @@ -2918,4 +2940,5 @@ window.parent.updateTableTitle( '', '