Announcement

  •  » Beta testing
  •  » [2.4.0 RC1] Parse error in cssmin.class.php on line 34

#1 2012-03-14 11:52:40

Brouno
Member
2006-07-07
8

[2.4.0 RC1] Parse error in cssmin.class.php on line 34

Hi, after installation of the 2.4.0 RC1 i get one error :

Parse error: syntax error, unexpected '"', expecting ')' in /mnt/171/sdb/6/c/brunogallerie/include/cssmin.class.php on line 34

Some investigations conduct me at this class in cssmin.class.php

class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin { private $re = array ( "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", "/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS" => "0" ); private $reMatch = "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS"; public function apply(aCssToken &$token) { if (preg_match($this->reMatch, $token->Value)) { foreach ($this->re as $reMatch => $reReplace) { $token->Value = preg_replace($reMatch, $reReplace, $token->Value); } } return false; } public function getTriggerTokens() { return array ( "CssAtFontFaceDeclarationToken", "CssAtPageDeclarationToken", "CssRulesetDeclarationToken" ); } }

For some reason that I didn't understand, there is a parse error here in last member of array $re and in the $reMatch
Theses regex look OK for me ...
By changing double quotes by single quote here, the parsing error doesn't occur ...
See changes here :

class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin { private $re = array ( "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", '/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS' => "0" ); private $reMatch = '/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS'; public function apply(aCssToken &$token) { if (preg_match($this->reMatch, $token->Value)) { foreach ($this->re as $reMatch => $reReplace) { $token->Value = preg_replace($reMatch, $reReplace, $token->Value); } } return false; } public function getTriggerTokens() { return array ( "CssAtFontFaceDeclarationToken", "CssAtPageDeclarationToken", "CssRulesetDeclarationToken" ); } }

But after this modification the compression of CSS doesn't work ... and I get a website with no css at all (the css compression process return blank css)
Then I bypass the compression in template.class.php :

1368 :     //$css = CssMin::minify($css, array('Variables'=>false));

... and all works fine (at the cost of full css)

Bruno.

Offline

 

#2 2012-03-14 12:02:22

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [2.4.0 RC1] Parse error in cssmin.class.php on line 34

Hi Brouno,

Are your correctly running PHP 5? (you can see your PHP version on Piwigo administration home page)

Offline

 

#3 2012-03-14 12:12:11

Brouno
Member
2006-07-07
8

Re: [2.4.0 RC1] Parse error in cssmin.class.php on line 34

Yep :

Environnement

        Système d'exploitation: Linux
        PHP: 5.1.3RC4-dev (Montrer les informations) [2012-03-14 12:10:55]
        mysql: 5.0.83 [2012-03-14 12:10:55]
        Bibliothèque graphique: GD bundled (2.0.28 compatible)

Base de données

        13958 photos (première photo ajoutée le Mercredi 05 Avril 2006)
        347 albums dont 288 physiques et 59 virtuels (14689 associations)
        9 tags (26 associations)
        37 utilisateurs
        8 groupes
        26 commentaires
        51 rates

Offline

 

#4 2012-03-14 12:17:56

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: [2.4.0 RC1] Parse error in cssmin.class.php on line 34

On the same hosting, does a Piwigo 2.3.3 works fine?

Offline

 

#5 2012-03-14 12:26:57

Brouno
Member
2006-07-07
8

Re: [2.4.0 RC1] Parse error in cssmin.class.php on line 34

yes,  right before the migration

Offline

 
  •  » Beta testing
  •  » [2.4.0 RC1] Parse error in cssmin.class.php on line 34

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact