MDL-67327 js: Make requirejs.php more fault tolerant
This commit is contained in:
+2
-2
@@ -104,7 +104,7 @@ if ($rev > 0 and $rev < (time() + 60 * 60)) {
|
||||
$js = rtrim($js);
|
||||
$js .= "\n";
|
||||
|
||||
if (preg_match('/define\(\s*\[/', $js)) {
|
||||
if (preg_match('/define\(\s*(\[|function)/', $js)) {
|
||||
// If the JavaScript module has been defined without specifying a name then we'll
|
||||
// add the Moodle module name now.
|
||||
$replace = 'define(\'' . $modulename . '\', ';
|
||||
@@ -157,7 +157,7 @@ if (!empty($jsfiles)) {
|
||||
$js = rtrim($js);
|
||||
}
|
||||
|
||||
if (preg_match('/define\(\s*\[/', $js)) {
|
||||
if (preg_match('/define\(\s*(\[|function)/', $js)) {
|
||||
// If the JavaScript module has been defined without specifying a name then we'll
|
||||
// add the Moodle module name now.
|
||||
$replace = 'define(\'' . $modulename . '\', ';
|
||||
|
||||
Reference in New Issue
Block a user