Joomla tags

a real free joomla tag system

  • Increase font size
  • Default font size
  • Decrease font size
 Joomla Tags Support Forum :: CssJsCompress
Welcome Guest   
Please read this before ask for help, thanks!   by joomlatags on 2009-02-22 03:49:59
 Subject :bug found when replacing css urls.. 2010-07-05 22:05:10 
fidoboy
Explorer
Joined: 2009-05-18 00:51:30
Posts: 21
Location
<p>I've noticed that the preg_replace_callback in function joomla_build_css_cache does not work with some code like this:</p>
<p> </p>
<p>div.mod-rounded div.module { background-image: url(../images/module_rounded_white_br.png); }<br />div.mod-rounded div.module-2 { background-image: url(../images/module_rounded_white_tr.png); }<br />div.mod-rounded div.module-3 { background-image: url(../images/module_rounded_white_bl.png); }<br />div.mod-rounded div.module-4 { background-image: url(../images/module_rounded_white_tl.png); }</p>
<p> </p>
<p>right now the code is:</p>
<p>preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_joomla_build_css_path', $contents);</p>
<p>and it fails replacing the urls causing that the css file doesn't work well. So, please, solve it.</p>
<p><br />EDIT:</p>
<p> </p>
<p>I'm sorry, the problem seems to be related with the imports into the function joomla_load_stylesheet, here:</p>
<p> </p>
<p>$contents = preg_replace_callback('/@import\s*(?:url\()?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\)?;/', '_joomla_load_stylesheet', $contents);</p>
<p> </p>
<p>regards,</p>
IP Logged
Last Edited On: 2010-07-05 22:05:10 By fidoboy for the Reason
 Subject :Re:bug found when replacing css urls.. 2010-07-06 05:40:33 
fidoboy
Explorer
Joined: 2009-05-18 00:51:30
Posts: 21
Location
<p>I'm trying to locate the problem, but i'm not sure. The final CSS file created by CssJSCompress is broken but i'm not sure about what function or command is causing the problem. I've added a few lines to log into a file the parsed urls and there i see that there is a certain url that is wrong, but i can't find why... :(</p>
<p>regards,</p>
IP Logged
 Subject :Re:bug found when replacing css urls.. 2010-07-06 08:39:35 
fidoboy
Explorer
Joined: 2009-05-18 00:51:30
Posts: 21
Location
<p>I think that i've located the problem, it's into the function _joomla_load_stylesheet that loads stylesheets recursively and returns contents with corrected paths. Into this function there is a line:</p>
<p>return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);</p>
<p>and the problem is that preg_replace does not add ) at the end, under certain circusntances. What do you think?</p>
<p>regards,</p>
IP Logged
Last Edited On: 2010-07-06 08:39:35 By fidoboy for the Reason
 Subject :Re:bug found when replacing css urls.. 2010-07-07 22:27:11 
fidoboy
Explorer
Joined: 2009-05-18 00:51:30
Posts: 21
Location
<p>I really need to solve this issue, can anybody help? The problem seems to happen only when there is @imports and the imported css files contains image backgrounds.</p>
<p> </p>
<p>regards,</p>
IP Logged
Page # 


Powered by ccBoard


Newsletter

Please subscribe to our newsletter to stay up-to-date with the latest news and release notifications delivered to your inbox.
Tags for Joomla



Joomla Plugin:ReadMoreExt