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:
stronk7
2008-04-18 16:59:47 +00:00
parent 0872afb8d2
commit e9b129a6a4
2 changed files with 22 additions and 2 deletions
+10
View File
@@ -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
View File
@@ -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@$");