From e93cdb6915447080630fd22af902dca37dbabbc4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 12 Jul 2013 11:41:12 +0100 Subject: [PATCH] MDL-40633 filter_urltolink breaking some image links. This was a regression caused by MDL-22390. HTML like was being broken. --- filter/urltolink/filter.php | 3 ++- filter/urltolink/tests/filter_test.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/filter/urltolink/filter.php b/filter/urltolink/filter.php index 9d01e8d0eb6..290e7ed3cdf 100644 --- a/filter/urltolink/filter.php +++ b/filter/urltolink/filter.php @@ -123,6 +123,7 @@ class filter_urltolink extends moodle_text_filter { } // TODO MDL-21296 - use of unicode modifiers may cause a timeout + $urlstart = '(?:http(s)?://|(?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', + '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. Commented out as part of MDL-21183 -- 2.43.0