Changeset 278 for trunk/lib/ImageThumb.inc.php
- Timestamp:
- Aug 1, 2007 3:44:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/ImageThumb.inc.php
r256 r278 345 345 // Ensure destination directories are created. This will only be called once per page load. 346 346 if (!$this->_createDestDirs()) { 347 $app->logMsg('Image resizing failed: unable to create dest dirs.', LOG_WARNING, __FILE__, __LINE__); 347 348 return false; 348 349 } … … 761 762 return false; 762 763 } 763 764 764 765 // Loop through specs and ensure all dirs are created. 765 766 foreach ($this->_image_specs as $spec) { … … 776 777 } 777 778 if (!file_exists($dest_dir)) { 779 $app->logMsg(sprintf('Creating dest dir: %s', $dest_dir), LOG_DEBUG, __FILE__, __LINE__); 778 780 if (phpversion() > '5') { 779 781 // Recursive. … … 785 787 // Recursive mkdir for php 4. 786 788 $path = ''; 789 $depth = 0; 790 $ret = true; 787 791 foreach (array_diff(explode('/', $dest_dir), array('')) as $dir) { 788 792 $path .= '/' . $dir; 789 if (! ($ret = file_exists($path) ? true : mkdir($path, $this->getParam('dest_dir_perms')))) { 793 $depth++; 794 /// FIXME: This is a dirty way to make this work when open_basedir prevents looking at the first 3 directories in an absolute path. 795 if ($depth > 3 && !($ret = file_exists($path) ? true : mkdir($path, $this->getParam('dest_dir_perms')))) { 790 796 $return_val++; 791 797 $app->logMsg(sprintf('mkdir failure: %s', $path), LOG_ERR, __FILE__, __LINE__); 792 798 break; 799 } else { 800 $app->logMsg(sprintf('mkdir attempt: %s', $path), LOG_DEBUG, __FILE__, __LINE__); 793 801 } 794 802 } … … 798 806 $app->logMsg(sprintf('mkdir success: %s', $dest_dir), LOG_DEBUG, __FILE__, __LINE__); 799 807 } 808 } else { 809 $app->logMsg(sprintf('Dest dir exists: %s', $dest_dir), LOG_DEBUG, __FILE__, __LINE__); 800 810 } 801 811 }
Note: See TracChangeset
for help on using the changeset viewer.