diff --git a/backup/backuplib.php b/backup/backuplib.php index 98a565e0f6d1e..50b3ae93059ca 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -457,6 +457,8 @@ function backup_general_info ($bf,$preferences) { fwrite ($bf,full_tag("BACKUP_RELEASE",2,false,$preferences->backup_release)); //The date fwrite ($bf,full_tag("DATE",2,false,$preferences->backup_unique_code)); + //The original site wwwroot + fwrite ($bf,full_tag("ORIGINAL_WWWROOT",2,false,$CFG->wwwroot)); //Te includes tag fwrite ($bf,start_tag("DETAILS",2,true)); //Now, go to mod element of preferences to print its status diff --git a/backup/restore_execute.html b/backup/restore_execute.html index eb25617aaf5f1..866eed4665525 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -10,6 +10,10 @@ $restore = $SESSION->restore; } + //Add info->original_wwwroot to $restore to be able to use it in all the restore process + //(mainly when decoding internal links) + $restore->original_wwwroot = $info->original_wwwroot; + //Check login require_login(); diff --git a/backup/restorelib.php b/backup/restorelib.php index e6ba723c0e818..199ce2d1a7839 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1946,6 +1946,9 @@ function endElementInfo($parser, $tagName) { case "DATE": $this->info->backup_date = $this->getContents(); break; + case "ORIGINAL_WWWROOT": + $this->info->original_wwwroot = $this->getContents(); + break; } } if ($this->tree[3] == "DETAILS") {