/** * Correct Stylesheet URI * * It enables the cache without loosing reference to URI * * @author oncletom * @since 1.2 * @version 1.2 * @param string $css parsed CSS * @param WPScssStylesheet Stylesheet currently processed * @return string parsed and fixed CSS */ public function filterStylesheetUri($css, WPScssStylesheet $stylesheet) { $this->_TmpBaseDir = dirname($stylesheet->getSourceUri()); return preg_replace_callback('#url\\s*\\((?P<quote>[\'"]{0,1})(?P<url>[^\'"\\)]+)\\1\\)#siU', array($this, '_filterStylesheetUri'), $css); unset($this->_TmpBaseDir); }