$value) { /** * 2005-02-22, rabus: * * This is just an ugly hotfix to avoid changing internal config * parameters. * * Currently, the following variable names are rejected when found in * $_GET or $_POST: cfg, GLOBALS, str* and _* */ if ($sanitize && is_string($key) && ( $key == 'cfg' || $key == 'GLOBALS' || substr($key, 0, 3) == 'str' || $key{0} == '_')) { continue; } if (is_array($value)) { // there could be a variable coming from a cookie of // another application, with the same name as this array unset($target[$key]); PMA_gpc_extract($value, $target[$key], FALSE); } else if ($is_magic_quotes) { $target[$key] = stripslashes($value); } else { $target[$key] = $value; } } return TRUE; } // check if a subform is submitted $__redirect = NULL; if ( isset( $_POST['usesubform'] ) ) { // if a subform is present and should be used // the rest of the form is deprecated $subform_id = key( $_POST['usesubform'] ); $subform = $_POST['subform'][$subform_id]; $_POST = $subform; if ( isset( $_POST['redirect'] ) && $_POST['redirect'] != basename( $_SERVER['PHP_SELF'] ) ) { $__redirect = $_POST['redirect']; unset( $_POST['redirect'] ); } // end if ( isset( $_POST['redirect'] ) ) } // end if ( isset( $_POST['usesubform'] ) ) // end check if a subform is submitted if (!empty($_GET)) { PMA_gpc_extract($_GET, $GLOBALS); } // end if if (!empty($_POST)) { PMA_gpc_extract($_POST, $GLOBALS); } // end if (!empty($_POST)) if (!empty($_FILES)) { foreach ($_FILES AS $name => $value) { $$name = $value['tmp_name']; ${$name . '_name'} = $value['name']; } } // end if if (!empty($_SERVER)) { $server_vars = array('PHP_SELF', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_AUTHORIZATION'); foreach ( $server_vars as $current ) { // its not important HOW we detect html tags // its more important to prevent XSS // so its not important if we result in an invalid string, // its even better than a XSS capable string if ( isset( $_SERVER[$current] ) && false === strpos( $_SERVER[$current], '<' ) ) { $$current = $_SERVER[$current]; // already importet by register_globals? } elseif ( ! isset( $$current ) || false !== strpos( $$current, '<' ) ) { $$current = ''; } } unset( $server_vars, $current ); } // end if // Security fix: disallow accessing serious server files via "?goto=" if (isset($goto) && strpos(' ' . $goto, '/') > 0 && substr($goto, 0, 2) != './') { unset($goto); } // end if if ( ! empty( $__redirect ) ) { // TODO: ensure that PMA_securePath() is defined and available // for this script. Meanwhile we duplicate what this function does: require('./' . preg_replace('@\.\.*@','.',$__redirect)); exit(); } // end if ( ! empty( $__redirect ) ) ?>