crnr / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Real Path issue - could not find internal image on PHP 5.2.9 #344

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download XAMPP 1.7.1
2. Install TimThumb
3. Try to load to a local image

Expect to see an image file, but see an internal image could not be found 
message.

This is using tim thumb 2.8.8, php 5.2.9 on Windows 7.

I found replacing line 871 worked for me, but it might mess up on php 5.3.

if(stripos($real, str_replace('/', DIRECTORY_SEPARATOR, $this->docRoot)) === 0){

to

if(stripos($real, $this->docRoot) === 0){

Because $real has /, not \.

I've never had a problem with this on my home dev machine (which is on PHP 5.3).

Hope this helps someone!

Original issue reported on code.google.com by toddis...@gmail.com on 22 Feb 2012 at 11:34

GoogleCodeExporter commented 8 years ago
With this change came to work properly.

Thank you.

Original comment by Luiz.Cla...@gmail.com on 22 Feb 2012 at 4:13

GoogleCodeExporter commented 8 years ago
thanks for the pointer - this has now been applied

Original comment by BinaryMoon on 23 Feb 2012 at 8:21