本文整理汇总了PHP中PMA_checkPageValidity函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_checkPageValidity函数的具体用法?PHP PMA_checkPageValidity怎么用?PHP PMA_checkPageValidity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_checkPageValidity函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGotoNowhere
/**
* Test for PMA_checkPageValidity
*
* @param string $page Page
* @param array|null $whiteList White list
* @param int $expected Expected value
*
* @return void
*
* @dataProvider provider
*/
function testGotoNowhere($page, $whiteList, $expected)
{
$this->assertTrue($expected === PMA_checkPageValidity($page, $whiteList));
}
示例2: unset
* holds page that should be displayed
* @global string $GLOBALS['goto']
*/
$GLOBALS['goto'] = '';
// Security fix: disallow accessing serious server files via "?goto="
if (PMA_checkPageValidity($_REQUEST['goto'], $goto_whitelist)) {
$GLOBALS['goto'] = $_REQUEST['goto'];
$GLOBALS['url_params']['goto'] = $_REQUEST['goto'];
} else {
unset($_REQUEST['goto'], $_GET['goto'], $_POST['goto'], $_COOKIE['goto']);
}
/**
* returning page
* @global string $GLOBALS['back']
*/
if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) {
$GLOBALS['back'] = $_REQUEST['back'];
} else {
unset($_REQUEST['back'], $_GET['back'], $_POST['back'], $_COOKIE['back']);
}
/**
* Check whether user supplied token is valid, if not remove any possibly
* dangerous stuff from request.
*
* remember that some objects in the session with session_start and __wakeup()
* could access this variables before we reach this point
* f.e. PMA_Config: fontsize
*
* @todo variables should be handled by their respective owners (objects)
* f.e. lang, server, collation_connection in PMA_Config
*/
示例3: testGotoWhitelistEncodedPage
function testGotoWhitelistEncodedPage()
{
$page = 'main.php%3Fsql.php%26test%3Dtrue';
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}