Beispiel #1
0
 /**
  * Finds all properties within a css string
  *
  * @author Anthony Short
  * @param $property string
  * @param $css string
  */
 public function find_property($property)
 {
     if (preg_match_all('/(' . Scaffold_Utils::preg_quote($property) . ')\\s*\\:\\s*(.*?)\\s*\\;/sx', $this->string, $matches)) {
         return (array) $matches;
     } else {
         return array();
     }
 }
Beispiel #2
0
 function testPregQuote()
 {
     $string = "#selector-name.class   {background: url(_images/blah.png); }";
     $string = Scaffold_Utils::preg_quote($string);
     $this->assertEqual($string, '\\#selector\\-name\\.class\\s*\\{background\\:\\s*url\\(_images\\/blah\\.png\\);\\s*\\}');
 }