Permalink
Browse files

Merge branch 'w07_MDL-26380_20_mediafilterperf' of git://github.com/s…

…kodak/moodle
  • Loading branch information...
2 parents 64ff7d5 + e68789c commit 42bdecde6de02c8b50950fc659ddc01b947787ff @stronk7 stronk7 committed Feb 14, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 filter/mediaplugin/filter.php
@@ -46,6 +46,11 @@ function filter($text, array $options = array()) {
// non string data can not be filtered anyway
return $text;
}
+ if (stripos($text, '</a>') === false) {
+ // performance shortcut - all regexes bellow end with the </a> 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)) {

0 comments on commit 42bdecd

Please sign in to comment.