Remove /g from regex

This commit is contained in:
Ceda EI 2018-04-02 18:10:58 +05:30
parent 2a9573a9e2
commit b28b8e20cb
1 changed files with 2 additions and 2 deletions

View File

@ -216,11 +216,11 @@ function kys() {
if (isset($decoded->{'message'}->{'reply_to_message'})) { if (isset($decoded->{'message'}->{'reply_to_message'})) {
if (isset($decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'})){ if (isset($decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'})){
$username = '@' . $decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'}; $username = '@' . $decoded->{'message'}->{'reply_to_message'}->{'from'}->{'username'};
$random_kys = preg_replace('/##name##/g', $username, $random_kys); $random_kys = preg_replace('/##name##/', $username, $random_kys);
} }
else { else {
$first_name = $decoded->{'message'}->{'reply_to_message'}->{'from'}->{'first_name'}; $first_name = $decoded->{'message'}->{'reply_to_message'}->{'from'}->{'first_name'};
$random_kys = preg_replace('/##name##/g', $first_name, $random_kys); $random_kys = preg_replace('/##name##/', $first_name, $random_kys);
} }
send_text($random_kys); send_text($random_kys);
} }