Exemplo n.º 1
0
 /**
  * @return void
  */
 public function __destruct()
 {
     if (self::$fixIE && isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') !== FALSE && in_array($this->code, array(400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505), TRUE) && $this->getHeader('Content-Type', 'text/html') === 'text/html') {
         echo Nette\String::random(2000.0, " \t\r\n");
         // sends invisible garbage for IE
         self::$fixIE = FALSE;
     }
 }
Exemplo n.º 2
0
 /**
  * @return void
  */
 public function __destruct()
 {
     if (self::$fixIE) {
         // Sends invisible garbage for IE.
         if (!isset($_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') === FALSE) {
             return;
         }
         if (!in_array($this->code, array(400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505), TRUE)) {
             return;
         }
         if ($this->getHeader('Content-Type', 'text/html') !== 'text/html') {
             return;
         }
         $s = " \t\r\n";
         for ($i = 2000.0; $i; $i--) {
             echo $s[rand(0, 3)];
         }
         self::$fixIE = FALSE;
     }
 }