pager_test_xss.php
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 43 行
PHP
43 行
<?php// $Id: pager_test_xss.php,v 1.1 2005/07/04 08:08:46 quipo Exp $//override url$_SERVER['PHP_SELF'] = '">test';require_once 'simple_include.php';require_once 'pager_include.php';class TestOfPagerXSS extends UnitTestCase { var $pager; var $baseurl; function TestOfPagerXSS($name='Test of Pager - XSS attacks') { $this->UnitTestCase($name); } function setUp() { $options = array( 'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 'perPage' => 5, ); $this->pager = Pager::factory($options); $this->baseurl = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')); } function tearDown() { unset($this->pager); } function testXSS() { $options = array( 'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 'perPage' => 5, 'nextImg' => '»' ); $this->pager = Pager::factory($options); $expected = ' <a href="./">test?pageID=2" title="next page">»</a> '; $this->assertEqual($expected, $this->pager->_getNextLink()); }}if (!defined('TEST_RUNNING')) { define('TEST_RUNNING', true); $test = &new TestOfPagerXSS(); $test->run(new HtmlReporter());}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?