Skip to content

Commit

Permalink
[BUGFIX] Fixed bug where inline css setting would parse non string va…
Browse files Browse the repository at this point in the history
…lues
  • Loading branch information
Sethorax committed May 22, 2017
1 parent 0e688b3 commit fdba874
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
32 changes: 17 additions & 15 deletions Classes/Hook/RenderPostProcessorHook.php
Expand Up @@ -130,22 +130,24 @@ protected function includeCssInline($settings, $pos)
foreach ($settings as $key => $value) {
$rawCss = $this->getSettingContent($settings, $key, $value);

if ($this->settings['minifyCSS'] === '1') {
$minifier = new MinificationUtility();
$css = $minifier->setMode('css')
->addContent($rawCss)
->minifyToString();
} else {
$css = $rawCss;
}
if (!is_array($rawCss)) {
if ($this->settings['minifyCSS'] === '1') {
$minifier = new MinificationUtility();
$css = $minifier->setMode('css')
->addContent($rawCss)
->minifyToString();
} else {
$css = $rawCss;
}

if (!empty($css)) {
$tag = new TagRenderer();
$this->params[$pos][] =
trim($tag->create('style')
->setContent($css)
->addAttribute('assetloader-' . $key)
->renderToString());
if (!empty($css)) {
$tag = new TagRenderer();
$this->params[$pos][] =
trim($tag->create('style')
->setContent($css)
->addAttribute('assetloader-' . $key)
->renderToString());
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "sethorax/typo3-assetloader",
"description": "Pagespeed friendly asset loader for TYPO3 CMS",
"type": "typo3-cms-extension",
"version": "0.9.2",
"version": "0.9.3",
"license": "GPL-3.0+",
"keywords": [
"TYPO3",
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Expand Up @@ -4,7 +4,7 @@
'title' => 'Assetloader',
'description' => 'Pagespeed friendly asset loader.',
'category' => 'frontend',
'version' => '0.9.2',
'version' => '0.9.3',
'state' => 'beta',
'uploadfolder' => 0,
'createDirs' => 'typo3temp/assetloader',
Expand Down

0 comments on commit fdba874

Please sign in to comment.