From ea2720fe2f01d32370ff1cd14665ee6d62e392ec Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Fri, 25 Nov 2005 10:39:45 +0000 Subject: [PATCH] respect arg_separator.input from php.ini --- ChangeLog | 4 +++- libraries/url_generating.lib.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8a9499b0f..f7a3d02a9 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,9 @@ $Id$ $Source$ 2005-11-24 Sebastian Mendel - * libraries/url_generating.lib.php: do not htmlentities on whole string + * libraries/url_generating.lib.php: + - do not htmlentities on whole string + - respect arg_separator.input from php.ini * libraries/common.lib.php: - make PMA_sendHeaderLocation() earlier available - add SID only if set diff --git a/libraries/url_generating.lib.php b/libraries/url_generating.lib.php index 5ce22bc2d..6ea2b4017 100644 --- a/libraries/url_generating.lib.php +++ b/libraries/url_generating.lib.php @@ -147,6 +147,24 @@ function PMA_generate_common_url ($db = '', $table = '', $delim = '&') $questionmark = ''; } + // 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 = '&'; + } + + // check wether to htmlentity the separator or not + if ( $delim === '&' ) { + $delim = htmlentities( $separator ); + } else { + $delim = $separator; + } + if ( $GLOBALS['server'] != $GLOBALS['cfg']['ServerDefault'] && ! empty( $GLOBALS['server'] ) ) { $params['server'] = $GLOBALS['server'];