Closed GoogleCodeExporter closed 8 years ago
Quick fix:
Make a new function:
protected function sortQueryStr($string){
//BECAUSE THIS CAN'T BE A ONE-LINER.
$arr = explode('&', $string);
asort($arr);
return implode('&', $arr);
}
Then wrap "$_SERVER ['QUERY_STRING']" on those 2 lines with the new function,
like:
$this->sortQueryStr($_SERVER ['QUERY_STRING'])
This resolved the issue for me.
Original comment by dasu...@gmail.com
on 8 Nov 2011 at 7:19
Is this a problem? How often are you going to change the query string order for
the images on your site? Just trying to work out how it would affect people
negatively
Original comment by BinaryMoon
on 24 Nov 2011 at 8:55
In my personal copy of timthumb, I added a rather CPU intensive dithering
algorithm as a thumbnailing option. This addition reduces the chance that a
curious user who's playing with the query string will trigger a (lengthy)
regeneration of the thumbnail. It also mildly reduces cache storage overhead by
only saving one copy of an image for any fixed set of query string parameters,
regardless of GET variable order.
I suspect this is an issue that won't perceptibly affect most timthumb users,
but I felt it would be useful to bring it to your attention as a possible area
of optimization.
Original comment by dasu...@gmail.com
on 24 Nov 2011 at 3:53
I don't think this will affect a large amount of people but I like the idea of
keeping things clean so I have added it in :)
This will be added in the next commit
Original comment by BinaryMoon
on 24 Nov 2011 at 10:50
Original issue reported on code.google.com by
dasu...@gmail.com
on 8 Nov 2011 at 3:37