Ignore:
Timestamp:
Jun 14, 2014, 8:14:18 AM (10 years ago)
Author:
mistic100
Message:

preg_replace(): The /e modifier is deprecated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/admin/UAM_admin.php

    r27178 r28699  
    12751275// |                              groups list                              |
    12761276// +-----------------------------------------------------------------------+
    1277 
    1278     $groups[-1] = '------------';
     1277    global $uam_groups; // used in callback
     1278    $uam_groups[-1] = '------------';
    12791279
    12801280    $query = '
     
    12881288    while ($row = pwg_db_fetch_assoc($result))
    12891289    {
    1290       $groups[$row['id']] = $row['name'];
     1290      $uam_groups[$row['id']] = $row['name'];
    12911291    }
    12921292
     
    13031303      $visible_user_list[] = $local_user;
    13041304    }
     1305   
     1306    $callback = create_function('$m', 'global $uam_groups; return $uam_groups[$m[1]];');
    13051307
    13061308    foreach ($visible_user_list as $local_user)
    13071309    {
    1308       $groups_string = preg_replace(
    1309         '/(\d+)/e',
    1310         "\$groups['$1']",
     1310      $groups_string = preg_replace_callback(
     1311        '/(\d+)/',
     1312        $callback,
    13111313        implode(
    13121314          ', ',
     
    13781380        )
    13791381      );
    1380     }   
     1382    }
     1383   
     1384    unset($uam_groups); // remove from global scope
    13811385
    13821386    // Check if validation of register is made by admin or visitor
Note: See TracChangeset for help on using the changeset viewer.