소스 검색

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