Fixed bug: #14184: Scheduler: Handle invalid serialized exception objects
authorFrancois Suter <francois.suter@typo3.org>
Sat, 19 Jun 2010 19:15:22 +0000 (19:15 +0000)
committerFrancois Suter <francois.suter@typo3.org>
Sat, 19 Jun 2010 19:15:22 +0000 (19:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7972 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/scheduler/mod1/index.php
typo3/sysext/scheduler/mod1/locallang.xml

index 9fa6d81..a21e4ce 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-19 Francois Suter  <francois@typo3.org>
+
+       * Fixed bug: #14184: Scheduler: Handle invalid serialized exception objects
+
 2010-06-19  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #14464: htmlArea RTE: Type of block accumulation if the block is manually selected in Safari
index b2b8860..f85feea 100755 (executable)
@@ -1118,8 +1118,14 @@ class tx_scheduler_Module extends t3lib_SCbase {
                                                // Check if the last run failed
                                        $failureOutput = '';
                                        if (!empty($schedulerRecord['lastexecution_failure'])) {
+                                                       // Try to get the stored exception object
                                                $exception = unserialize($schedulerRecord['lastexecution_failure']);
-                                               $failureDetail = sprintf($GLOBALS['LANG']->getLL('msg.executionFailureReport'), $exception->getCode(), $exception->getMessage());
+                                                       // If the exception could not be unserialized, issue a default error message
+                                               if ($exception === FALSE) {
+                                                       $failureDetail = $GLOBALS['LANG']->getLL('msg.executionFailureDefault');
+                                               } else {
+                                                       $failureDetail = sprintf($GLOBALS['LANG']->getLL('msg.executionFailureReport'), $exception->getCode(), $exception->getMessage());
+                                               }
                                                $failureOutput = ' <img ' . t3lib_iconWorks::skinImg(t3lib_extMgm::extRelPath('scheduler'), 'res/gfx/status_failure.png') . ' alt="' . htmlspecialchars($GLOBALS['LANG']->getLL('status.failure')) . '" title="' . htmlspecialchars($failureDetail) . '" />';
                                        }
 
index 60d3f3d..286874c 100644 (file)
@@ -69,6 +69,7 @@
                        <label index="msg.noTasks">No tasks defined yet.</label>
                        <label index="msg.notExecuted">Not executed: %s</label>
                        <label index="msg.executionFailed">Execution of task "%1$s" failed with the following message: %2$s</label>
+                       <label index="msg.executionFailureDefault">The execution failed, but the error message could not be retrieved (it was probably too large). Sorry.</label>
                        <label index="msg.executionFailureReport">Execution failed: %1$d, %2$s</label>
                        <label index="msg.noStartDate">Please define a start date.</label>
                        <label index="msg.invalidStartDate">Start date is invalid.</label>