$value) { $$name = $value['tmp_name']; ${$name . '_name'} = $value['name']; } unset( $name, $value ); } // 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 unset( $_import_blacklist ); 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 ) ) } else { // Security fix: disallow accessing serious server files via "?goto=" if ( isset( $_REQUEST['goto'] ) && strpos( $_REQUEST['goto'], '\\' ) !== false && strpos( $_REQUEST['goto'], '/' ) !== false ) { unset( $_REQUEST['goto'], $_GET['goto'], $_POST['goto'], $_COOKIE['goto'] ); } // end if /** * 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' ); } ?>