diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index dcbd253c1cf..4ff2c1cc8ee 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -1,5 +1,4 @@ trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0bbe816d8b3..004033474f7 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -476,8 +476,10 @@ if ($action == 'addcontainer') // Remove comments $tmp['content'] = removeHtmlComment($tmp['content']); - preg_match('/
(.*)<\/head>/ims', $tmp['content'], $reg); - $head = $reg[1]; + $regs=array(); + + preg_match('/(.*)<\/head>/ims', $tmp['content'], $regs); + $head = $regs[1]; $objectpage->type_container = 'page'; $objectpage->pageurl = $pageurl; @@ -488,8 +490,10 @@ if ($action == 'addcontainer') } $objectpage->aliasalt = ''; - if (preg_match('/^(\d+)\-/', basename($urltograb), $reg)) $objectpage->aliasalt = $reg[1]; + if (preg_match('/^(\d+)\-/', basename($urltograb), $regs)) $objectpage->aliasalt = $regs[1]; + + $regtmp=array(); if (preg_match('/'.$contentforlessc.''; + $contentforlessc = $lesscobj->compile($contentforlessc); + //var_dump($contentforlessc); exit; + + $pagecsscontent.=$contentforlessc."\n"; + //$pagecsscontent.=$tmpgeturl['content']."\n"; + } catch (exception $e) { + //echo "failed to compile lessc"; + dol_syslog("Failed to compile the CSS ".$urltograbbis." that we caught, with lessc: ".$e->getMessage(), LOG_WARNING); + $pagecsscontent.=$tmpgeturl['content']."\n"; + } $objectpage->htmlheader = preg_replace('/'.preg_quote($regs[0][$key], '/').'\n*/ims', '', $objectpage->htmlheader); }