tkale86 / timthumb

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

Internal images fail on OSX #278

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using Apache on OSX
2. use image path such as /uploads/2011/07/abc.jpg
3. Errors out with "Could not find the internal image you specified."

What is the expected output? What do you see instead?
The image

What version of the product are you using? On what operating system?
2.8.2 (latest as of today) on osx

Please provide any additional information below.
The problem is that docroot on osx is /private/var/www, but it is recognized by 
timthumb as /var/www and therefore does not qualify for the check on line 

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

What I did for a quick workaround was replace the line with:

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

You guys decide if you want to use it like this or move the realpathing of 
docroot further up the code, so that it works with the correct path at all 
times....

best regards,
miro

Original issue reported on code.google.com by meosofts...@gmail.com on 27 Oct 2011 at 7:52