فهرست منبع

Detect Chrome through the user agent in ChromePhpHandler

The header will be sent only to Chrome, avoiding issues with IE for
long headers.
Christophe Coevoet 14 سال پیش
والد
کامیت
68702d3bfa
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      src/Monolog/Handler/ChromePhpHandler.php

+ 2 - 4
src/Monolog/Handler/ChromePhpHandler.php

@@ -121,9 +121,7 @@ class ChromePhpHandler extends AbstractProcessingHandler
      */
     protected function headersAccepted()
     {
-        return true;
-        /*return !isset($_SERVER['HTTP_USER_AGENT'])
-               || preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])
-               || isset($_SERVER['HTTP_X_FIREPHP_VERSION']);*/
+        return !isset($_SERVER['HTTP_USER_AGENT'])
+               || preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']);
     }
 }