From 8045696b3797765c51dee1df34e05841fdcc31ca Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Mon, 6 Oct 2014 23:02:41 +0200 Subject: [PATCH] MDL-36669 Filters: Remove the last ref to the UFO library. --- lib/filelib.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/filelib.php b/lib/filelib.php index cc794469f2047..7fcd08d445f74 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -2764,21 +2764,17 @@ function file_modify_html_header($text) { global $CFG; $stylesheetshtml = ''; -/* foreach ($CFG->stylesheets as $stylesheet) { +/* + foreach ($CFG->stylesheets as $stylesheet) { //TODO: MDL-21120 $stylesheetshtml .= ''."\n"; - }*/ - - $ufo = ''; - if (filter_is_enabled('mediaplugin')) { - // this script is needed by most media filter plugins. - $attributes = array('type'=>'text/javascript', 'src'=>$CFG->httpswwwroot . '/lib/ufo.js'); - $ufo = html_writer::tag('script', '', $attributes) . "\n"; } +*/ + // TODO The code below is actually a waste of CPU. When MDL-29738 will be implemented it should be re-evaluated too. preg_match('/\|\/', $text, $matches); if ($matches) { - $replacement = ''.$ufo.$stylesheetshtml; + $replacement = ''.$stylesheetshtml; $text = preg_replace('/\|\/', $replacement, $text, 1); return $text; } @@ -2787,7 +2783,7 @@ function file_modify_html_header($text) { preg_match('/\|\/', $text, $matches); if ($matches) { // replace tag with includes - $replacement = ''."\n".''.$ufo.$stylesheetshtml.''; + $replacement = ''."\n".''.$stylesheetshtml.''; $text = preg_replace('/\|\/', $replacement, $text, 1); return $text; } @@ -2795,13 +2791,13 @@ function file_modify_html_header($text) { // if not, look for tag, and stick before body preg_match('/\|\/', $text, $matches); if ($matches) { - $replacement = ''.$ufo.$stylesheetshtml.''."\n".''; + $replacement = ''.$stylesheetshtml.''."\n".''; $text = preg_replace('/\|\/', $replacement, $text, 1); return $text; } // if not, just stick a tag at the beginning - $text = ''.$ufo.$stylesheetshtml.''."\n".$text; + $text = ''.$stylesheetshtml.''."\n".$text; return $text; }