Skip to content

Commit

Permalink
Update compatiable with Joomla 3.7
Browse files Browse the repository at this point in the history
Update to work with J3.7
http://pm.joomlart.com/browse/T3-115
  • Loading branch information
Dang Quoc Dat authored Mar 20, 2017
1 parent 3e8f62e commit 439a955
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/plg_system_t3/includes/core/minify.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static function optimizecss($tpl)
$mediagroup['all'] = array();
$mediagroup['screen'] = array();
foreach ($doc->_styleSheets as $url => $stylesheet) {
$media = $stylesheet['media'] ? $stylesheet['media'] : 'all';
$media = !empty($stylesheet['media']) ? $stylesheet['media'] : 'all';
if (empty($mediagroup[$media])) {
$mediagroup[$media] = array();
}
Expand All @@ -269,7 +269,7 @@ public static function optimizecss($tpl)
foreach ($group as $url => $stylesheet) {
$url = self::fixUrl($url);

if ($stylesheet['mime'] == 'text/css' && ($csspath = self::cssPath($url))) {
if ((!empty($stylesheet['mime']) && $stylesheet['mime'] == 'text/css' || $stylesheet['type'] == 'text/css') && ($csspath = self::cssPath($url))) {
$stylesheet['path'] = $csspath;
$stylesheet['data'] = file_get_contents($csspath);

Expand Down Expand Up @@ -396,7 +396,7 @@ public static function optimizecss($tpl)

$output[$outputurl . '/' . $groupname] = array(
'mime' => 'text/css',
'media' => $media == 'all' ? NULL : $media,
'media' => $media,
'attribs' => array()
);
}
Expand Down Expand Up @@ -437,7 +437,7 @@ public static function optimizejs($tpl){

$url = self::fixUrl($url);

if ($script['mime'] == 'text/javascript' && ($jspath = self::jsPath($url))) {
if (((!empty($script['mime']) && $script['mime'] == 'text/javascript') || $script['type'] == 'text/javascript') && ($jspath = self::jsPath($url))) {

$script['path'] = $jspath;
$script['data'] = file_get_contents($jspath);
Expand Down Expand Up @@ -545,4 +545,4 @@ public static function optimizejs($tpl){
$doc->_scripts = $output;
}
}
?>
?>

0 comments on commit 439a955

Please sign in to comment.