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:
@@ -17,6 +17,8 @@ use Monolog\Logger;
|
|||||||
/**
|
/**
|
||||||
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
|
* 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>
|
* @author Christophe Coevoet <stof@notk.org>
|
||||||
*/
|
*/
|
||||||
class ChromePHPHandler extends AbstractProcessingHandler
|
class ChromePHPHandler extends AbstractProcessingHandler
|
||||||
@@ -175,7 +177,8 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
|||||||
return false;
|
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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user