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;
}
if($i == $groupCount AND $delete == false) {
$regex = '#([0-9]{1,3})#e';
$replacement = '("$1" + 1)';
$newName = preg_replace($regex, $replacement, $group['channel_name']);
$regex = '#([0-9]{1,3})#';
$callback = function ($matches) {
return $matches[0]+1;
}
$newName = preg_replace($regex, $callback, $group['channel_name']);
createChannel($server, $newName, $sub, $options);
}
}

Loading…
Cancel
Save