1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 20:57:36 +02:00

Add support for firefox in ChromePHPHandler

This commit is contained in:
Jordi Boggiano
2016-03-01 17:13:07 +00:00
parent 3521455e51
commit fa96f6aa8f

View File

@@ -17,6 +17,8 @@ use Monolog\Logger;
/**
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
*
* This also works out of the box with Firefox 43+
*
* @author Christophe Coevoet <stof@notk.org>
*/
class ChromePHPHandler extends AbstractProcessingHandler
@@ -175,7 +177,8 @@ class ChromePHPHandler extends AbstractProcessingHandler
return false;
}
return preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']);
// matches any Chrome, or Firefox 43+
return preg_match('{\b(?:Chrome/\d+(?:\.\d+)*|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}', $_SERVER['HTTP_USER_AGENT']);
}
/**