mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 04:44:25 +02:00
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()
|
public static function compileForPdf()
|
||||||
{
|
{
|
||||||
|
self::checkPhp();
|
||||||
$less = new LessCompiler();
|
$less = new LessCompiler();
|
||||||
$basedir = Icinga::app()->getBootstrapDirectory();
|
$basedir = Icinga::app()->getBootstrapDirectory();
|
||||||
foreach (self::$lessFiles as $file) {
|
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)
|
public static function send($minified = false)
|
||||||
{
|
{
|
||||||
|
self::checkPhp();
|
||||||
$app = Icinga::app();
|
$app = Icinga::app();
|
||||||
$basedir = $app->getBootstrapDirectory();
|
$basedir = $app->getBootstrapDirectory();
|
||||||
foreach (self::$lessFiles as $file) {
|
foreach (self::$lessFiles as $file) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user