Explorar el Código

Fix error with trying to resend the header on a fatal error.

We *really* need to figure out why changes to member variables aren't being remembered outside of the member function in which they are changed.  This is afflicting the Template class and the Error class.
stevetruckstuff hace 19 años
padre
commit
69f9454fbb
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      class/error.class.php

+ 2 - 1
class/error.class.php

@@ -63,6 +63,7 @@ class ErrorHandler {
      */
     function HeaderSent() {
         $this->header_sent = true;
+        $this->Template->assign('header_sent', true);
     }
 
     /**
@@ -218,7 +219,7 @@ class ErrorHandler {
 
         // Show the error immediate in case of fatal errors
         if ($iType == SQM_ERROR) {
-            if (!$this->header_sent) {
+            if (!$this->header_sent || (isset($this->Template->values['header_sent']) && !$this->Template->values['header_sent'])) {
                 // TODO replace this with template that can be assigned
                 displayHtmlHeader(_("Error"),'',false);
             }