aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-06-29 04:26:22 +0000
committerrvelices <rv-github@modusoptimus.com>2012-06-29 04:26:22 +0000
commitf3c84114ef7310aa7b5d3e52ed56497b3c1726da (patch)
tree7a018b4fd4d255b3f18a3027d098ab597bcedd19 /admin
parentde1166c7f22104d8e22294f44060484e688632bf (diff)
bug 2668 - fix php warnings on glob function (merge from trunk to 2.4)
git-svn-id: http://piwigo.org/svn/branches/2.4@16168 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/configuration.php7
-rw-r--r--admin/include/functions.php7
2 files changed, 10 insertions, 4 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 21e5c2b4d..5ea0da672 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -514,9 +514,12 @@ switch ($page['section'])
{
$watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
}
- foreach (glob(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/*.png') as $file)
+ if ( ($glob=glob(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/*.png')) !== false)
{
- $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
+ foreach ($glob as $file)
+ {
+ $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH));
+ }
}
$watermark_filemap = array( '' => '---' );
foreach( $watermark_files as $file)
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 9218ce3e3..85295e472 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2360,9 +2360,12 @@ function delete_element_derivatives($infos, $type='all')
$pattern = '-'.derivative_to_url($type).'*';
}
$path = substr_replace($path, $pattern, $dot, 0);
- foreach( glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path) as $file)
+ if ( ($glob=glob(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$path)) !== false)
{
- @unlink($file);
+ foreach( $glob as $file)
+ {
+ @unlink($file);
+ }
}
}
?> \ No newline at end of file