示例#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 NStrings::random(2e3, " \t\r\n"); // sends invisible garbage for IE
			self::$fixIE = FALSE;
		}
	}
示例#2
0
 function __destruct()
 {
     if (self::$fixIE) {
         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;
     }
 }