replace preg_replace with preg_replace_callback

/e is not supported starting with php 7.0
master
lub 5 years ago
parent 41ded50525
commit 92160fd812

@ -34,9 +34,11 @@ while(true) {
$delete = true; $delete = true;
} }
if($i == $groupCount AND $delete == false) { if($i == $groupCount AND $delete == false) {
$regex = '#([0-9]{1,3})#e'; $regex = '#([0-9]{1,3})#';
$replacement = '("$1" + 1)'; $callback = function ($matches) {
$newName = preg_replace($regex, $replacement, $group['channel_name']); return $matches[0]+1;
}
$newName = preg_replace($regex, $callback, $group['channel_name']);
createChannel($server, $newName, $sub, $options); createChannel($server, $newName, $sub, $options);
} }
} }
@ -46,4 +48,4 @@ while(true) {
} }
} }
sleep(1); sleep(1);
} }

Loading…
Cancel
Save