get rid of propicon
This commit is contained in:
39
test/escape_js_string.php
Normal file
39
test/escape_js_string.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/* $Id: common.lib.php 9832 2007-01-09 09:50:49Z nijel $ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
/**
|
||||
* Test for javascript escaping.
|
||||
*
|
||||
* @author Michal Čihař <michal@cihar.com>
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tests core.
|
||||
*/
|
||||
include('./core.lib.php');
|
||||
/**
|
||||
* Include to test.
|
||||
*/
|
||||
include('./libraries/js_escape.lib.php');
|
||||
|
||||
/**
|
||||
* Test java script escaping.
|
||||
*
|
||||
* @uses PMA_escapeJsString()
|
||||
* @uses PMA_test_string()
|
||||
* @param string string to escape
|
||||
* @param string expected result
|
||||
*/
|
||||
function PMA_test_escape($test, $expected) {
|
||||
PMA_test_string('PMA_escapeJsString', $test, PMA_escapeJsString($test), $expected);
|
||||
}
|
||||
|
||||
PMA_test_escape('\';', '\\\';');
|
||||
PMA_test_escape("\r\n'<scrIpt></sCRIPT>", '\r\n\\\'<scrIpt></\' + \'script>');
|
||||
PMA_test_escape('\';[XSS]', '\\\';[XSS]');
|
||||
PMA_test_escape('</SCRIPT></head><body>[HTML]', '</\' + \'script></head><body>[HTML]');
|
||||
PMA_test_escape('"\'\\\'"', '"\\\'\\\\\\\'"');
|
||||
PMA_test_escape("\\''''''''''''\\", "\\\\\'\'\'\'\'\'\'\'\'\'\'\'\\\\");
|
||||
?>
|
Reference in New Issue
Block a user