From 9dd05f1db777a09a0a48d954df2c76c6390a2959 Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Tue, 12 Jan 2010 13:33:25 +0000 Subject: [PATCH] MDL-21168 - Added test for URLs with encoded paths and queries and fixed some onew. Merged from 19_STABLE --- lib/simpletest/testweblib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/simpletest/testweblib.php b/lib/simpletest/testweblib.php index 7ff45b6d0b..6b342a63c4 100644 --- a/lib/simpletest/testweblib.php +++ b/lib/simpletest/testweblib.php @@ -235,7 +235,7 @@ END; 'http://Iñtërnâtiônàlizætiøn.com?ô=nëø'=>'http://Iñtërnâtiônàlizætiøn.com?ô=nëø', 'www.Iñtërnâtiônàlizætiøn.com?ô=nëø'=>'www.Iñtërnâtiônàlizætiøn.com?ô=nëø', //text containing utf 8 characters outside of a url -+ 'Iñtërnâtiônàlizætiøn is important to http://moodle.org'=>'Iñtërnâtiônàlizætiøn is important to http://moodle.org', + 'Iñtërnâtiônàlizætiøn is important to http://moodle.org'=>'Iñtërnâtiônàlizætiøn is important to http://moodle.org', //too hard to identify without additional regexs 'moodle.org' => 'moodle.org', //some text with no link between related html tags @@ -256,8 +256,14 @@ END; //fully escaped img tag. Do we want this to work on escaped text? MDL-21183 htmlspecialchars('fully escaped img tag ') => 'fully escaped img tag <img src="http://moodle.org/logo/logo-240x60.gif" />', //Double http with www - 'One more link like http://www.moodle.org to test' => 'One more link like http://www.moodle.org to test', -+ //URLs in Javascript + 'One more link like http://www.moodle.org to test' => 'One more link like http://www.moodle.org to test', + //Encoded URLs in the path + 'URL: http://127.0.0.1/one%28parenthesis%29/path?param=value' => 'URL: http://127.0.0.1/one%28parenthesis%29/path?param=value', + 'URL: www.localhost.com/one%28parenthesis%29/path?param=value' => 'URL: www.localhost.com/one%28parenthesis%29/path?param=value', + //Encoded URLs in the query + 'URL: http://127.0.0.1/path/to?param=value_with%28parenthesis%29¶m2=1' => 'URL: http://127.0.0.1/path/to?param=value_with%28parenthesis%29¶m2=1', + 'URL: www.localhost.com/path/to?param=value_with%28parenthesis%29¶m2=1' => 'URL: www.localhost.com/path/to?param=value_with%28parenthesis%29¶m2=1', + //URLs in Javascript 'var url="http://moodle.org";'=>'var url="http://moodle.org";', 'var url = "http://moodle.org";'=>'var url = "http://moodle.org";', 'var url="www.moodle.org";'=>'var url="www.moodle.org";', -- 2.39.5