From 9ee07221ecc2a6907e05ffbee9c6a707d3e749a9 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Wed, 22 Jan 2014 12:05:27 +0000 Subject: Merged revision(s) 26904 from branches/2.6: bug 2989: Deprecated: preg_replace(): The /e modifier is deprecated git-svn-id: http://piwigo.org/svn/trunk@26905 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/include/functions.php b/admin/include/functions.php index 71c164822..36fc9d93e 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -810,14 +810,18 @@ SELECT id, uppercats, site_id $categories = array_from_query($query); // filling $cat_fulldirs + $cat_dirs_callback = create_function('$m', 'global $cat_dirs; return $cat_dirs[$m[1]];'); + $cat_fulldirs = array(); foreach ($categories as $category) { $uppercats = str_replace(',', '/', $category['uppercats']); $cat_fulldirs[$category['id']] = $galleries_url[$category['site_id']]; - $cat_fulldirs[$category['id']].= preg_replace('/(\d+)/e', - "\$cat_dirs['$1']", - $uppercats); + $cat_fulldirs[$category['id']].= preg_replace_callback( + '/(\d+)/', + $cat_dirs_callback, + $uppercats + ); } return $cat_fulldirs; -- cgit v1.2.3