Преглед на файлове

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()
     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']);
     }
     }
 }
 }