--- brilliant_gallery-orig.module 2009-09-07 18:17:11.000000000 -0400 +++ brilliant_gallery.module 2009-09-07 18:04:41.000000000 -0400 @@ -359,14 +359,14 @@ $rp = file_directory_path(); if ($galleryfolder <> '') { $rp .= '/'. $galleryfolder; } - $absolpath = realpath($rp); + $absolpath = $rp; $result .= '
'; $result .= '
This page allows you to set or unset visibility of each image (data item) in all Brilliant galleries there are on this website.'; #$result .= '
Files folder: ' . file_directory_path() . '/'; ob_start(); - $recurs = bg_iterative_recurse_dir($absolpath); + $recurs = bg_iterative_recurse_dir(realpath($absolpath)); #echo '
'; print_r( $recurs ); echo ''; #echo '
'; print_r( $retval_dimensions ); echo ''; $result .= ob_get_contents(); $dirshavefiles = array(); @@ -386,14 +386,15 @@ } else { $rootfolder = ''; } - $path_middle = str_replace($absolpath, '', $key); + $path_middle = str_replace(realpath($absolpath), '', $key); + $gallerypath = '/' . $galleryfolder . $path_middle; $result .= '
max: ' . $maxpoct; @@ -430,9 +431,9 @@ #} #else { # Important to begin with the "/" otherwise thumbnails in non-root folders fail. See http://drupal.org/node/175292 #&dummy=.jpg - $displayimage .= ''; + $displayimage .= ''; $displayimage .= ''; } else { $displayimage .= ''; @@ -633,13 +634,9 @@ #echo $absolpath; #drupal_set_message(t('absol: '.$absolpath)); } else { - $rp = file_directory_path(); - if ($galleryfolder <> '') { - $rp .= '/'. $galleryfolder; - } - $absolpath = realpath($rp); + $absolpath = '/'. $galleryfolder; } #$result .= $absolpath; # Make an array with images in this folder, and their properties. --- image-orig.php 2009-07-03 12:06:18.000000000 -0400 +++ image.php 2009-09-07 18:10:11.000000000 -0400 @@ -1,9 +1,14 @@ 0 || + ($_GET['imgw'] + $_GET['imgh']) < 10 || + ($_GET['imgw'] + $_GET['imgh']) > 20000 ) { header("HTTP/1.0 404 Not Found"); exit(); } @@ -13,12 +18,16 @@ chdir('..'); } #module_load_include('/includes/bootstrap.inc', 'image', 'includes/bootstrap'); require_once './includes/bootstrap.inc'; + require_once './includes/file.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); // See http://drupal.org/node/211378#comment-924059 #drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); #drupal_cron_run(); } + +$imagepath = realpath(file_directory_path() . $urlpath); + # Crucial - to suppress Devel (if installed and enabled) output appearing in the generated XML! $GLOBALS['devel_shutdown'] = FALSE; # Cache expiration time. $bgcachexpire = 3600 * 24 * 3; @@ -114,11 +123,9 @@ return $my_data; } function resizeimage($imgp, $imgw, $imgh) { - $imagepath = base64_decode($imgp); - #echo '.... ' . base64_decode( $imgp ); - #flush();die(' stop!'); + global $imagepath; # Thanks to MichaĆ Albrecht! $suffix = strtolower(substr($imagepath, -4)); $imgsize = @getimagesize($imagepath); # http://be.php.net/getimagesize --- functions-orig.inc 2009-09-07 18:17:26.000000000 -0400 +++ functions.inc 2009-09-07 18:13:27.000000000 -0400 @@ -39,9 +39,10 @@ function load_dir_to_array($absolpath, $imagewidth, $fullresolutionmaxwidth, $brilliant_gallery_sort) { # Load Directory Into Array $poct = -1; $retval_dimensions = array(); - $handle = opendir($absolpath); + $actualpath = realpath(file_directory_path() . $absolpath); + $handle = opendir($actualpath); $imagemaxh = 0; while ($file = @readdir($handle)) { $testending = strtolower(substr($file, -4, 4)); if (!testext($file) and strtolower($testending) <> '.mpg' and strtolower($testending) <> '.swf' and strtolower($testending) <> '.mov' and strtolower($testending) <> '.avi') { @@ -52,9 +53,9 @@ #$retval[$poct] = $file; $retval_dimensions[$poct]['file'] = $file; # Is image horizontally or vertically oriented? - $temp = getimagesize($absolpath .'/'. $file); + $temp = getimagesize($actualpath .'/'. $file); if ($temp === false) { continue; } if (($temp[0] - $temp[1]) >= 0) {