Web\StyleSheet: PCRE problem workaround, PHP5.3.7
Lines with embedded fonts where too long for lessphp's PCRE matches unless PHP 5.3.7
This commit is contained in:
parent
c68f9502ea
commit
f86d3e7636
|
@ -31,6 +31,7 @@ class StyleSheet
|
|||
|
||||
public static function compileForPdf()
|
||||
{
|
||||
self::checkPhp();
|
||||
$less = new LessCompiler();
|
||||
$basedir = Icinga::app()->getBootstrapDirectory();
|
||||
foreach (self::$lessFiles as $file) {
|
||||
|
@ -55,8 +56,17 @@ class StyleSheet
|
|||
);
|
||||
}
|
||||
|
||||
protected static function checkPhp()
|
||||
{
|
||||
// PHP had a rather conservative PCRE backtrack limit unless 5.3.7
|
||||
if (version_compare(PHP_VERSION, '5.3.7') <= 0) {
|
||||
ini_set('pcre.backtrack_limit', 1000000);
|
||||
}
|
||||
}
|
||||
|
||||
public static function send($minified = false)
|
||||
{
|
||||
self::checkPhp();
|
||||
$app = Icinga::app();
|
||||
$basedir = $app->getBootstrapDirectory();
|
||||
foreach (self::$lessFiles as $file) {
|
||||
|
|
Loading…
Reference in New Issue