diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index 6508c5bec09..f1455fd71b1 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -907,7 +907,8 @@ class required_js extends linked_requirement { } public function get_html() { - return ajax_get_link_to_script($this->url); + $attributes = array('type'=>'text/javascript', 'src'=>$this->url); + return html_writer::tag('script', $attributes, '') . "\n"; } /** @@ -1276,15 +1277,6 @@ class required_event_handler extends required_js_code { } } -/** - * Return the HTML required to link to a JavaScript file. - * @param $url the URL of a JavaScript file. - * @return string the required HTML. - */ -function ajax_get_link_to_script($url) { - return '' . "\n"; -} - /** * Returns whether ajax is enabled/allowed or not. diff --git a/lib/filelib.php b/lib/filelib.php index 64fa743ab03..37806b97542 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -2076,7 +2076,8 @@ function file_modify_html_header($text) { $ufo = ''; if (filter_is_enabled('filter/mediaplugin')) { // this script is needed by most media filter plugins. - $ufo = ajax_get_link_to_script($CFG->wwwroot . '/lib/ufo.js'); + $attributes = array('type'=>'text/javascript', 'src'=>$CFG->httpswwwroot . '/lib/ufo.js'); + $ufo = html_writer::tag('script', $attributes, '') . "\n"; } preg_match('/\|\/', $text, $matches);