[Resolved] [FIX] Incorrect data-src encoding for non-english characters in filename
I was having a problem when the “hiDPI” and “responsive” images options were active (both, or either one by themselves). Images with non-english characters in their filenames (e.g. ñ, á, é, ó, among others) were not being displayed at all.
A closer look revealed that the src parameter passed to thumb.php was incorrectly encoded for these characters. in fact, loading the image by itself in a new tab showed a TimThumb error “Could not find the internal image you specified.”
I traced the source of the problem to line 36 of the file js/bj-lazy-load.js:
imgurl = BJLL.thumb_base + escape( srcimgurl ) + '&w=' + loadimgwidth;
I changed the previous line to:
imgurl = BJLL.thumb_base + encodeURIComponent( srcimgurl ) + '&w=' + loadimgwidth;
And i’ts now working for me without any issues. “ñàâáçü©åœ®.jpg” gets downscaled and shown as expected.
If you find that the above is correct and solves the issue, would you consider updating the plugin?
Again, THX for such a nice piece of software. It works very good and transparent.
PD: for anyone in need of a quick fix to this particular issue:
- Find the file “bj-lazy-load/js/combined.min.js”.
- in line Nº20, find the spot where it says
- replace the call to escape() so it reads
- The topic ‘[Resolved] [FIX] Incorrect data-src encoding for non-english characters in filename’ is closed to new replies.