Do not choke on arrays in $_SERVER array (bug #1370414).

This commit is contained in:
Michal Čihař
2005-12-08 19:36:32 +00:00
parent 2472e2f3aa
commit 044b696570
2 changed files with 17 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ $Source$
writable permissions, refuse to work with existing config dir.
* lang/*, libraries/auth/config.auth.lib.php: Suggest to run setup script
if auth with default values fails.
* libraries/grab_globals.lib.php: Do not choke on arrays in $_SERVER
array (bug #1370414).
2005-12-08 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/tbl_move_copy.php: added PMA_table_rename()

View File

@@ -192,8 +192,21 @@ if ( $__redirect || ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) {
$_COOKIE['goto'] );
} // end if
array_walk( $_SERVER, 'strip_tags' );
array_walk( $_ENV, 'strip_tags' );
/**
* Recursive wrapper around strip_tags to process also arrays.
*
* @param mixed array or string to strip tags
*/
function array_strip_tags(&$item) {
if (is_array($item)) {
array_walk($item, 'array_strip_tags');
} else {
strip_tags($item);
}
}
array_walk( $_SERVER, 'array_strip_tags' );
array_walk( $_ENV, 'array_strip_tags' );
}
?>