From 68702d3bfaacd3e1431a724c3aba6cb05fb2d0c7 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 20 Feb 2012 02:30:03 +0100 Subject: [PATCH] Detect Chrome through the user agent in ChromePhpHandler The header will be sent only to Chrome, avoiding issues with IE for long headers. --- src/Monolog/Handler/ChromePhpHandler.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Monolog/Handler/ChromePhpHandler.php b/src/Monolog/Handler/ChromePhpHandler.php index 4e0372ab..f76cf1ab 100644 --- a/src/Monolog/Handler/ChromePhpHandler.php +++ b/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']); } } \ No newline at end of file