Menu

#44 config_temp_directory issues with open_basedir

closed-fixed
nobody
None
5
2007-07-27
2007-07-11
No

phpThumb v1.7.7-200612252156
Using phpthumb.php

My system has open_basedir restrictions ON (set to site's folder only) and when using the latest phpThumb release, phpthumb.php does the following:
- instantiate a phpThumb class
- load the config file
- set variables in phpThumb instance

The problem stands at line 219 of phpthumb.class.php:
$this->config_temp_directory = realpath($this->config_temp_directory ? $this->config_temp_directory : (getenv('TMPDIR') ? getenv('TMPDIR') : getenv('TMP')));

As no default config_temp_directory has been set in the class file (phpthumb.class.php), the code will try to get the TMPDIR or TMP path, which outputs a nice warning when open_basedir restrictions are in effect.

Possible problem resolution:
Don't set the config_temp_directory at class construction but only when necessary (phpThumb_tempnam() and setCacheDirectory()).
Indeed, if using phpthumb.php, the config_temp_directory variable will be set and there will be no need to check for TMPDIR or TMP environment variables.

Discussion

  • James Heinrich

    James Heinrich - 2007-07-12
    • summary: Bug when using phpthumb.php --> config_temp_directory issues with open_basedir
    • status: open --> pending-fixed
     
  • James Heinrich

    James Heinrich - 2007-07-12

    Logged In: YES
    user_id=429434
    Originator: NO

    Implemented as suggested in v1.7.8-200707120837
    Please try the latest beta version:
    http://phpthumb.sourceforge.net/phpThumb.zip

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.