From 15fb52fbcbb725a35ff60207f1b99399427597ba Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 15 Dec 2007 13:21:12 +0000 Subject: [PATCH] MDL-8992 eoas hack added only when really needed, removed slow fullclone; merged from MOODLE_19_STABLE --- filter/mediaplugin/filter.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/filter/mediaplugin/filter.php b/filter/mediaplugin/filter.php index ac925d48b3..e5f9117db5 100644 --- a/filter/mediaplugin/filter.php +++ b/filter/mediaplugin/filter.php @@ -31,7 +31,11 @@ function mediaplugin_filter($courseid, $text) { // We're using the UFO technique for flash to attain XHTML Strict 1.0 // See: http://www.bobbyvandersluis.com/ufo/ - $newtext = fullclone($text); + if (!is_string($text)) { + // non string data can not be filtered anyway + return $text; + } + $newtext = $text; // fullclone is slow and not needed here if ($CFG->filter_mediaplugin_enable_mp3) { $search = '/]*>.*?<\/a>/is'; @@ -83,8 +87,9 @@ function mediaplugin_filter($courseid, $text) { $newtext = preg_replace_callback($search, 'mediaplugin_filter_real_callback', $newtext); } - if (is_null($newtext)) { - $newtext = $text; + if (is_null($newtext) or $newtext === $text) { + // error or not filtered + return $text; } if (!$eolas_fix_applied) { -- 2.39.5