From: Eloy Lafuente Date: Fri, 8 Jan 2010 22:25:13 +0000 (+0000) Subject: MDL-21168 avoid http://www.whatever to be linked twice ; merged from 19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fd81d5bd37aa496fa86469e026a5229bd8a7c085;p=moodle.git MDL-21168 avoid http://www.whatever to be linked twice ; merged from 19_STABLE --- diff --git a/lib/simpletest/testweblib.php b/lib/simpletest/testweblib.php index c80a5e0deb..1b144baa14 100644 --- a/lib/simpletest/testweblib.php +++ b/lib/simpletest/testweblib.php @@ -244,10 +244,16 @@ END; '
This is some text. www.moodle.com then some more text
' => '
This is some text. www.moodle.com then some more text
', //check we aren't modifying img tags 'image' => 'image', + 'image' => 'image', + //and another url within one tag + ' ' => ' ', + ' ' => ' ', //partially escaped img tag 'partially escaped img tag <img src="http://moodle.org/logo/logo-240x60.gif" />' => 'partially escaped img tag <img src="http://moodle.org/logo/logo-240x60.gif" />', //fully escaped img tag 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' ); foreach ($texts as $text => $correctresult) { $msg = "Testing text: ". str_replace('%', '%%', $text) . ": %s"; // Escape original '%' so sprintf() wont get confused