X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fclavette_www.git;a=blobdiff_plain;f=www%2Fplugins-dist%2Fcompresseur%2Flib%2Fcsstidy%2Fclass.csstidy.php;h=ff380a94c6b8c6eae3451bd927d0bb8d232c9246;hp=29b847902f5cc159fd69015787ce7c3430ed23a3;hb=cc641eb476987612f6d6df1a5417c1c5582a8ab8;hpb=7d84a490677fb716a1fd4df260f8eab35f6a8506 diff --git a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php index 29b8479..ff380a9 100644 --- a/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php +++ b/www/plugins-dist/compresseur/lib/csstidy/class.csstidy.php @@ -33,23 +33,28 @@ */ /** - * Defines ctype functions if required - * @todo make them methods of csstidy class - * @version 1.0 + * Defines ctype functions if required. + * + * @TODO: Make these methods of CSSTidy. + * @since 1.0.0 */ -if (!function_exists('ctype_space')) { - /* ctype_space Check for whitespace character(s) */ - function ctype_space($text) { - return!preg_match("/[^\s\r\n\t\f]/", $text); +if (!function_exists('ctype_space')){ + /* ctype_space Check for whitespace character(s) */ + function ctype_space($text){ + return (1===preg_match("/^[ \r\n\t\f]+$/", $text)); } - } -if (!function_exists('ctype_alpha')) { - /* ctype_alpha Check for alphabetic character(s) */ - function ctype_alpha($text) { - return preg_match("/[a-zA-Z]/", $text); +if (!function_exists('ctype_alpha')){ + /* ctype_alpha Check for alphabetic character(s) */ + function ctype_alpha($text){ + return (1===preg_match('/^[a-zA-Z]+$/', $text)); + } +} +if (!function_exists('ctype_xdigit')){ + /* ctype_xdigit Check for HEX character(s) */ + function ctype_xdigit($text){ + return (1===preg_match('/^[a-fA-F0-9]+$/', $text)); } - } /** @@ -89,7 +94,7 @@ require('class.csstidy_optimise.php'); * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php * @package csstidy * @author Florian Schmitz (floele at gmail dot com) 2005-2006 - * @version 1.5.2 + * @version 1.5.5 */ class csstidy { @@ -142,7 +147,7 @@ class csstidy { * @var string * @access private */ - public $version = '1.5.2'; + public $version = '1.5.5'; /** * Stores the settings * @var array @@ -297,6 +302,7 @@ class csstidy { */ $this->settings['optimise_shorthands'] = 1; $this->settings['remove_last_;'] = true; + $this->settings['space_before_important'] = false; /* rewrite all properties with low case, better for later gzip OK, safe*/ $this->settings['case_properties'] = 1; /* sort properties in alpabetic order, better for later gzip @@ -616,7 +622,7 @@ class csstidy { $this->at .= $this->_unicode($string, $i); } // fix for complicated media, i.e @media screen and (-webkit-min-device-pixel-ratio:1.5) - elseif (in_array($string{$i}, array('(', ')', ':', '.'))) { + elseif (in_array($string{$i}, array('(', ')', ':', '.', '/'))) { $this->at .= $string{$i}; } } else { @@ -694,8 +700,8 @@ class csstidy { $this->sel_separate[] = strlen($this->selector); } elseif ($string{$i} === '\\') { $this->selector .= $this->_unicode($string, $i); - } elseif ($string{$i} === '*' && @in_array($string{$i + 1}, array('.', '#', '[', ':'))) { - // remove unnecessary universal selector, FS#147 + } elseif ($string{$i} === '*' && @in_array($string{$i + 1}, array('.', '#', '[', ':')) && ($i==0 OR $string{$i - 1}!=='/')) { + // remove unnecessary universal selector, FS#147, but not comment in selector } else { $this->selector .= $string{$i}; }