From a05c8c538a6a1a907dade83fc6c8e3b66bf6253f Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 29 Jun 2012 04:25:02 +0000 Subject: bug 2668 - fix php warnings on glob function git-svn-id: http://piwigo.org/svn/trunk@16167 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'admin/include') 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 -- cgit v1.2.3