pesce88 / phppi

Automatically exported from code.google.com/p/phppi
GNU General Public License v3.0
0 stars 0 forks source link

Thumbnails are missing for paths with + #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Place in the gallery an image containing plus sign (+) it its name
2. or create a folder with + in its name
3.

What is the expected output? What do you see instead?
Thumbnail is not rendered if its path contains + sign

What version of PHPPI are you using? On what operating system?
1.1.1

Please provide any additional information below.
Browsers or PHP replace + sign in the url with a space
(perhaps it is done according to RFC 3986),
phhpi gets the path with a space instead of + sign,
and, of course, fails to find an image.

Suggested solution:
Replace + sign in the thumbnail URL with %2B
<code>
    function genThumbURL($dir, $file_data) {
...
        return preg_replace('/\+/', '%2B', $img_url);
    }
</code>

Original issue reported on code.google.com by eug...@hutorny.in.ua on 24 Nov 2012 at 4:21