Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /usr/share/nginx/html/piwigo/admin/include/functions.php on line 611
1. automatic upgrade
piwigo2.6.0 → 2.6.1
2. service nginx restart
3. service php5-fpm restart
----------------------------------------
Album Manage - Changing the order of the album - Save Manual Order Click
The same problem occurred
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /usr/share/nginx/html/piwigo/admin/include/functions.php on line 611
----------------------------------------
Piwigo version
Piwigo 2.6.1
Check for upgrade
Subscribe moodcela@gmail.com to Piwigo Announcements Newsletter
Environment
Operating system: Linux
PHP: 5.5.3-1ubuntu2.1 (Show info) [2014-01-26 09:11:10]
MySQL: 5.5.34-MariaDB-1~saucy-log [2014-01-26 09:11:10]
Graphics Library: GD 2.1.1-dev
Hello
thanks for the report but a minimum of politeness would be great
Offline
my piwigo site address
http://photo.volo.kr
( http://volonas.iptime.org:8080/piwigo)
mistic100 wrote:
Hello
thanks for the report but a minimum of politeness would be great
This problem already described in [Forum, topic 23233] sync page lost its HEAD and [Forum, topic 23239] Piwigo 2.6 but still present:(
Pls, check also:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/piwigo/admin/include/themes.class.php on line 697
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/piwigo/admin/include/languages.class.php on line 410
Offline
Hi there
My system is using PHP 5.5.9 and I just upgraded to 2.6.1 and encounter such an error.
This is what I do and it looks like it works:
Two files need to modify.
See below. The commented line (#) is the original line):
File #1, themes.php (in piwigo/admin/include)
Look for this function (should be at line #692):
function theme_version_compare($a, $b)
{
# $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
$pattern = array('/([a-z])/i', '/\.+/', '/\.\Z|\A\./');
$replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
# $array = preg_replace($pattern, $replacement, array($a, $b));
$array = preg_replace_callback($pattern,
function ($replacement) {
return $replacement[0];
}, array($a, $b));
return version_compare($array[0], $array[1], '>=');
}
Then for file #2, languages.php (in piwigo/admin/include)
Look for this function (should be at line #405)
function language_version_compare($a, $b)
{
# $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
$pattern = array('/([a-z])/i', '/\.+/', '/\.\Z|\A\./');
$replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
# $array = preg_replace($pattern, $replacement, array($a, $b));
$array = preg_replace_callback($pattern,
function ($replacement) {
return $replacement[0];
}, array($a, $b));
return version_compare($array[0], $array[1], '>=');
}
Hope this will help anyone who encounter similar problem.
Offline
When creating new album, realized that another file that need modify to fix the "preg_replace()"
For file #3 (same location..that is piwigo/admin/include)
Filename: functions.php
Somewhere in line #605:
foreach( $cat_map as $id=>$cat )
{
/*
$new_global_rank = preg_replace(
'/(\d+)/e',
"\$cat_map['$1']['rank']",
str_replace(',', '.', $cat['uppercats'] )
);
*/
$new_global_rank = preg_replace_callback(
'/(\d+)/',
function () {
$return_value = "\$cat_map['$1']['rank']";
return $return_value[0];
},
str_replace(',', '.', $cat['uppercats'] )
);
Offline
thanks but all has already been updated
[Subversion] r26998 + [Subversion] r27156
[Subversion] r26972
ad you patch use Closures, introduced in PHP 5.3 so we can't use it :)
Offline
Hi all,
could you please kindly help me, how to update my piwigo, currently I have 2.6.1, but still error message
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/p/admin/include/functions.php on line 611
appears.
Thank you very much
Best Regards
Martin
Offline
apply theses changes to the file
http://piwigo.org/dev/changeset/26972#file1
Offline
I'm using v2.6.1.
I had this same problem too and dug into the code to find out where the problem was. It looks like there is a fix for it in,
http://piwigo.org/dev/changeset/26972#file1
I could update my piwigo files with those changes, but I'd much rather install a new version of piwigo. Will these changes be in the next version of piwigo? and when?
***As a developer myself, it sucks when new versions of php comes out with deprecated functions. it's suck a pain to update code.
Offline