MDL-14072 - Backported from HEAD. Prevent NULLs, empties and numbers to be processed by:
- backup_encode_absolute_links() at backup - restore_decode_absolute_links() at restore
This commit is contained in:
@@ -1778,6 +1778,16 @@
|
||||
|
||||
global $CFG,$preferences;
|
||||
|
||||
/// MDL-14072: Prevent NULLs, empties and numbers to be processed by the
|
||||
/// heavy interlinking. Just a few cpu cycles saved.
|
||||
if ($content === NULL) {
|
||||
return NULL;
|
||||
} else if ($content === '') {
|
||||
return '';
|
||||
} else if (is_numeric($content)) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
//Use one static variable to cache all the require_once calls that,
|
||||
//under PHP5 seems to increase load too much, and we are requiring
|
||||
//them here thousands of times (one per content). MDL-8700.
|
||||
|
||||
+12
-2
@@ -2607,8 +2607,18 @@
|
||||
//step in the restore execution, because we need to have it
|
||||
//finished to know all the oldid, newid equivaleces
|
||||
function restore_decode_absolute_links($content) {
|
||||
|
||||
global $CFG,$restore;
|
||||
|
||||
global $CFG,$restore;
|
||||
|
||||
/// MDL-14072: Prevent NULLs, empties and numbers to be processed by the
|
||||
/// heavy interlinking. Just a few cpu cycles saved.
|
||||
if ($content === NULL) {
|
||||
return NULL;
|
||||
} else if ($content === '') {
|
||||
return '';
|
||||
} else if (is_numeric($content)) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
//Now decode wwwroot and file.php calls
|
||||
$search = array ("$@FILEPHP@$");
|
||||
|
||||
Reference in New Issue
Block a user