diff --git a/filter/mediaplugin/filter.php b/filter/mediaplugin/filter.php index 4db3a460832..fb3801c5654 100644 --- a/filter/mediaplugin/filter.php +++ b/filter/mediaplugin/filter.php @@ -46,6 +46,11 @@ class filter_mediaplugin extends moodle_text_filter { // non string data can not be filtered anyway return $text; } + if (stripos($text, '') === false) { + // performance shortcut - all regexes bellow end with the tag, + // if not present nothing can match + return $text; + } $newtext = $text; // fullclone is slow and not needed here if (!empty($CFG->filter_mediaplugin_enable_mp3)) {