/** * Test for PMA_cleanupPathInfo * * @param string $php_self The PHP_SELF value * @param string $request The REQUEST_URI value * @param string $path_info The PATH_INFO value * @param string $expected Expected result * * @return void * * @dataProvider pathsProvider */ public function testPahtInfo($php_self, $request, $path_info, $expected) { $_SERVER['PHP_SELF'] = $php_self; $_SERVER['REQUEST_URI'] = $request; $_SERVER['PATH_INFO'] = $path_info; PMA_cleanupPathInfo(); $this->assertEquals($expected, $GLOBALS['PMA_PHP_SELF']); }
* the relation lib, tracker needs it */ require './libraries/relation.lib.php'; if (!defined('PMA_MINIMUM_COMMON')) { /** * JavaScript escaping. */ include_once './libraries/js_escape.lib.php'; /** * Include URL/hidden inputs generating. */ include_once './libraries/url_generating.lib.php'; } /******************************************************************************/ /* start procedural code label_start_procedural */ PMA_cleanupPathInfo(); /** * just to be sure there was no import (registering) before here * we empty the global space (but avoid unsetting $variables_list * and $key in the foreach (), we still need them!) */ $variables_whitelist = array('GLOBALS', '_SERVER', '_GET', '_POST', '_REQUEST', '_FILES', '_ENV', '_COOKIE', '_SESSION', 'error_handler', 'PMA_PHP_SELF', 'variables_whitelist', 'key'); foreach (get_defined_vars() as $key => $value) { if (!in_array($key, $variables_whitelist)) { unset(${$key}); } } unset($key, $value, $variables_whitelist); /** * Subforms - some functions need to be called by form, cause of the limited URL * length, but if this functions inside another form you cannot just open a new