"MDL-21141, fixed a regression introduced by last commit, thanks for testing, jerome"
This commit is contained in:
@@ -185,21 +185,22 @@ class page_requirements_manager {
|
||||
*/
|
||||
public function css($stylesheet, $fullurl = false) {
|
||||
global $CFG;
|
||||
if (!$fullurl) {
|
||||
if (!file_exists($CFG->dirroot . '/' . strtok($stylesheet, '?'))) {
|
||||
throw new coding_exception('Attempt to require a CSS file that does not exist.', $stylesheet);
|
||||
}
|
||||
$url = $CFG->httpswwwroot . '/' . $stylesheet;
|
||||
} else {
|
||||
$url = $stylesheet;
|
||||
}
|
||||
|
||||
if (isset($this->linkedrequirements[$url])) {
|
||||
// already required, ignore it
|
||||
return;
|
||||
} else {
|
||||
if ($this->headdone) {
|
||||
throw new coding_exception('Cannot require a CSS file after <head> has been printed.', $stylesheet);
|
||||
}
|
||||
if (!$fullurl) {
|
||||
if (!file_exists($CFG->dirroot . '/' . strtok($stylesheet, '?'))) {
|
||||
throw new coding_exception('Attempt to require a CSS file that does not exist.', $stylesheet);
|
||||
}
|
||||
$url = $CFG->httpswwwroot . '/' . $stylesheet;
|
||||
} else {
|
||||
$url = $stylesheet;
|
||||
}
|
||||
$this->linkedrequirements[$url] = new required_css($this, $url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user