image.php & thumbnail.php blank page when php safe_mode = on

Forum rules
Support ended: 31.12.2011

image.php & thumbnail.php blank page when php safe_mode = on

Postby bellzebu » Tue Dec 02, 2008 2:06 am

Gallery Version: 0.4.0
phpBB Version: 3.0.3
Gallery Component: files of the gallery/-directory
Gallery-Link

PHP Version: 5.2.6
Database Version: 5.0.51a


Errormessage:
    Code: Select all
    Warning: readfile() has been disabled for security reasons

Errordescription and message
This it not a support request, a suggestion only

If php is on safe mode, readfile function is not available, so image.php and thumbnail.php does not show images, a blank page only.

I have modified both scripts adding an extra check for readfile (it is a sample only)

Code: Select all
if (@readfile($phpbb_root_path . GALLERY_CACHE_PATH . $image_data['image_thumbnail']) == false)
{
   $fp = @fopen($phpbb_root_path . GALLERY_CACHE_PATH . $image_data['image_thumbnail'], 'rb');
      if ($fp !== false)
      {
         while (!feof($fp))
         {
            echo fread($fp, 8192);
         }
         fclose($fp);
      }
}
flush();


and it works perfectly.

Cheers.
bellzebu
Posts < 10
Posts < 10
 
Posts: 8
Topics: 2
Joined: Fri Nov 28, 2008 4:53 pm

Re: image.php & thumbnail.php blank page when php safe_mode = on

Postby nickvergessen » Tue Dec 02, 2008 12:14 pm

please make a bug report in the tracker, but note that thumbnail.php is not used any longer since 0.4.0
cheers nickvergessen :geek:

Member of phpBB Development-Team
No Support via PM
User avatar
nickvergessen
Administrator
Administrator
 
Posts: 5748
Topics: 217
Images: 139
Joined: Mon Oct 15, 2007 4:15 pm
phpBB.de: nickvergessen
phpBB.com: nickvergessen

Re: image.php & thumbnail.php blank page when php safe_mode = on

Postby bellzebu » Tue Dec 02, 2008 1:39 pm

nickvergessen wrote:please make a bug report in the tracker, but note that thumbnail.php is not used any longer since 0.4.0


True, Nick, I did review all gallery php scripts to find readfile uses :), my mistake.

Cheers.
bellzebu
Posts < 10
Posts < 10
 
Posts: 8
Topics: 2
Joined: Fri Nov 28, 2008 4:53 pm


Return to Support & Administration

Who is online

Users browsing this forum: No registered users and 0 guests