diff --git a/backup/util/dbops/backup_controller_dbops.class.php b/backup/util/dbops/backup_controller_dbops.class.php index 06aa4230761..0b5fb9b6386 100644 --- a/backup/util/dbops/backup_controller_dbops.class.php +++ b/backup/util/dbops/backup_controller_dbops.class.php @@ -105,6 +105,12 @@ abstract class backup_controller_dbops extends backup_dbops { throw new backup_dbops_exception('backup_controller_dbops_nonexisting'); } $controller = unserialize(base64_decode($controllerrec->controller)); + if (!is_object($controller)) { + // The controller field of the table did not contain a serialized object. + // It is made empty after it has been used successfully, it is likely that + // the user has pressed the browser back button at some point. + throw new backup_dbops_exception('backup_controller_dbops_loading_invalid_controller'); + } // Check checksum is ok. Sounds silly but it isn't ;-) if (!$controller->is_checksum_correct($controllerrec->checksum)) { throw new backup_dbops_exception('backup_controller_dbops_loading_checksum_mismatch'); diff --git a/backup/util/dbops/restore_controller_dbops.class.php b/backup/util/dbops/restore_controller_dbops.class.php index b68358e22f6..5691a925c4e 100644 --- a/backup/util/dbops/restore_controller_dbops.class.php +++ b/backup/util/dbops/restore_controller_dbops.class.php @@ -95,6 +95,12 @@ abstract class restore_controller_dbops extends restore_dbops { throw new backup_dbops_exception('restore_controller_dbops_nonexisting'); } $controller = unserialize(base64_decode($controllerrec->controller)); + if (!is_object($controller)) { + // The controller field of the table did not contain a serialized object. + // It is made empty after it has been used successfully, it is likely that + // the user has pressed the browser back button at some point. + throw new backup_dbops_exception('restore_controller_dbops_loading_invalid_controller'); + } // Check checksum is ok. Sounds silly but it isn't ;-) if (!$controller->is_checksum_correct($controllerrec->checksum)) { throw new backup_dbops_exception('restore_controller_dbops_loading_checksum_mismatch');