Thursday, June 9, 2011

Timthumb and filenames with spaces issue

It is known that some of older timthumb.php versions have an issue with displaying pictures with spaces in their file names.
Altering the timthumb.php file:
1. just because I am paranoid, before the call of clean_source($src); (around line 40) function I added
$src = urldecode($src);
On front side I generate the pictures sources from jQuery + jquery.urldecoder.min.js and use $.url.encode(picture_source)
2. comment line (about 672) containing the code:
$src = str_replace (' ', '%20', $src);

Or best thing to do: update the timthumb.php file to last version!

No comments: