Пример #1
0
 /**
  * Process CSS URL callback
  *
  * @param array  $mathes     Matches
  * @param string $filePrefix File prefix
  *
  * @return string
  */
 public function processCSSURLHandler(array $mathes, $filePrefix)
 {
     $url = trim($mathes[1]);
     if (!preg_match('/^[\'"]?data:/Ss', $url)) {
         $first = substr($url, 0, 1);
         if ('"' == $first || '\'' == $first) {
             $url = stripslashes(substr($url, 1, -1));
         }
         if (!preg_match('/^(?:https?:)?\\/\\//Ss', $url)) {
             if ('/' != substr($url, 0, 1)) {
                 $url = $filePrefix . $url;
             }
             $url = \Includes\Utils\URLManager::getProtoRelativeShopURL($url, array(), \Includes\Utils\URLManager::URL_OUTPUT_SHORT);
         }
         if (preg_match('/[\'"]/Ss', $url)) {
             $url = '"' . addslashes($url) . '"';
         }
     }
     return 'url(' . $url . ')';
 }