Skip to content

Commit

Permalink
fix for empty media attributes on assets
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Sep 29, 2015
1 parent c614d27 commit 5781402
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,13 @@ public function css($attributes = [])
$output = '';
if ($this->css_pipeline) {
$output .= '<link href="' . $this->pipeline(CSS_ASSET) . '"' . $attributes . ' />' . "\n";

foreach ($this->css_no_pipeline as $file) {
$media = $file['media'] ? sprintf(' media="%s"', $file['media']) : ' ';
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
$output .= '<link href="' . $file['asset'] . $this->timestamp . '"' . $attributes . $media . ' />' . "\n";
}
} else {
foreach ($this->css as $file) {
$media = $file['media'] ? sprintf(' media="%s"', $file['media']) : ' ';
$media = isset($file['media']) ? sprintf(' media="%s"', $file['media']) : '';
$output .= '<link href="' . $file['asset'] . $this->timestamp . '"' . $attributes . $media . ' />' . "\n";
}
}
Expand Down

0 comments on commit 5781402

Please sign in to comment.