-
AuthorPosts
-
msbragi Friend
msbragi
- Join date:
- November 2007
- Posts:
- 10
- Downloads:
- 5
- Uploads:
- 7
- Thanked:
- 2 times in 1 posts
March 9, 2013 at 5:53 pm #185684Hi all,
have discovered a bug with T3V3 today.
When optimize CSS is enabled in general tab if you have a link to a css like this:
/plugins/system/jcemediabox/css/jcemediabox.css?version=116 (with extra characters after the path)
optimization fails abd you have an optimized file like this:/*===============================
/plugins/system/jcemediabox/css/jcemediabox.css?version=116
================================================================================*//*===============================
/plugins/system/jcemediabox/themes/standard/css/style.css?version=116
================================================================================*/As you can see the resulting file is is empty becouse the function T3Minify::optimizecss() fails.
The fast solution i found (tested) is to insert this statement around line 104 of file minify.php
$url = preg_replace(‘#[?#]+.*$#’, ”, $url);[PHP]
// plugins/system/t3/includes/core/minify.php around line 103
foreach ($doc->_styleSheets as $url => $stylesheet) {
if ($stylesheet[‘mime’] == ‘text/css’ && self::minifiable($url)) {
/*
* Remove extra characters after pathname
*/
$url = preg_replace(‘#[?#]+.*$#’, ”, $url);$stylesheet[‘path’] = self::fromUrlToPath($url);
$stylesheet[‘data’] = @JFile::read($stylesheet[‘path’]);$selcount = preg_match_all($regex, $stylesheet[‘data’], $matched);
if(!$selcount) {
$selcount = 1; //just for sure
}
[/PHP]Another more elegant solution may be to modify the function T3Minify::minifiable() to return the correct parsed url or false for not processing the file.
I hope my explanation was clear.
Thanks to joomlart and the developers for the T3 framework a piece of cake.
AuthorPostsViewing 1 post (of 1 total)This topic contains 1 reply, has 1 voice, and was last updated by msbragi 11 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
For developer one Bug and solution (CSS minify)
Viewing 1 post (of 1 total)