Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-10-22 18:41:18 +02:00
commit 5f50dc9e8a
2 changed files with 20 additions and 14 deletions

View File

@ -521,25 +521,13 @@ if ($token_mismatch) {
* current selected database
* @global string $GLOBALS['db']
*/
$GLOBALS['db'] = '';
if (PMA_isValid($_REQUEST['db'])) {
// can we strip tags from this?
// only \ and / is not allowed in db names for MySQL
$GLOBALS['db'] = $_REQUEST['db'];
$GLOBALS['url_params']['db'] = $GLOBALS['db'];
}
PMA_setGlobalDbOrTable('db');
/**
* current selected table
* @global string $GLOBALS['table']
*/
$GLOBALS['table'] = '';
if (PMA_isValid($_REQUEST['table'])) {
// can we strip tags from this?
// only \ and / is not allowed in table names for MySQL
$GLOBALS['table'] = $_REQUEST['table'];
$GLOBALS['url_params']['table'] = $GLOBALS['table'];
}
PMA_setGlobalDbOrTable('table');
/**
* Store currently selected recent table.

View File

@ -1029,4 +1029,22 @@ function PMA_setPostAsGlobal($post_patterns)
}
}
}
/**
* Creates some globals from $_REQUEST
*
* @param string $param db|table
*
* @return void
*/
function PMA_setGlobalDbOrTable($param)
{
$GLOBALS[$param] = '';
if (PMA_isValid($_REQUEST[$param])) {
// can we strip tags from this?
// only \ and / is not allowed in db names for MySQL
$GLOBALS[$param] = $_REQUEST[$param];
$GLOBALS['url_params'][$param] = $GLOBALS[$param];
}
}
?>