guess url param separator only once;
optionally encode it;
This commit is contained in:
@@ -134,7 +134,7 @@ function PMA_generate_common_hidden_inputs($db = '', $table = '', $indent = 0, $
|
||||
*
|
||||
* @author nijel
|
||||
*/
|
||||
function PMA_generate_common_url ($db = '', $table = '', $delim = '&')
|
||||
function PMA_generate_common_url($db = '', $table = '', $delim = '&')
|
||||
{
|
||||
if (is_array($db)) {
|
||||
$params =& $db;
|
||||
@@ -200,22 +200,38 @@ function PMA_generate_common_url ($db = '', $table = '', $delim = '&')
|
||||
/**
|
||||
* Returns url separator
|
||||
*
|
||||
* @return string character used for separating url parts
|
||||
*
|
||||
* @uses ini_get()
|
||||
* @uses strpos()
|
||||
* @uses strlen()
|
||||
* @param string whether to encode separator or not, currently 'none' or 'html'
|
||||
* @return string character used for separating url parts usally ; or &
|
||||
* @access public
|
||||
*
|
||||
* @author nijel
|
||||
*/
|
||||
function PMA_get_arg_separator() {
|
||||
function PMA_get_arg_separator($encoded = 'none')
|
||||
{
|
||||
static $separator = null;
|
||||
|
||||
if (null === $separator) {
|
||||
// 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) {
|
||||
return ';';
|
||||
$separator = ';';
|
||||
} elseif (strlen($php_arg_separator_input) > 0) {
|
||||
return $php_arg_separator_input{0};
|
||||
$separator = $php_arg_separator_input{0};
|
||||
} else {
|
||||
return '&';
|
||||
$separator = '&';
|
||||
}
|
||||
}
|
||||
|
||||
switch ($encoded) {
|
||||
case 'html':
|
||||
return htmlentities($separator);
|
||||
break;
|
||||
case 'none' :
|
||||
default :
|
||||
return $separator;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user