mirror of
https://github.com/scratchfoundation/swiki-confirmaccount.git
synced 2024-12-04 12:51:01 -05:00
fixed regex detection of scratch team members with asterisk in username
This commit is contained in:
parent
60576cf843
commit
6d719cfd47
1 changed files with 2 additions and 2 deletions
|
@ -112,14 +112,14 @@ class AccountRequestSubmission {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$success = false;
|
$success = false;
|
||||||
preg_match_all('%<div id="comments-\d+" class="comment +" data-comment-id="\d+">.*?<div class="actions-wrap">.*?<div class="name">\s+<a href="/users/(([a-zA-Z0-9]|-|_)+)">(([a-zA-Z0-9]|-|_)+)</a>\s+</div>\s+<div class="content">(.*?)</div>%ms', $data, $matches);
|
preg_match_all('%<div id="comments-\d+" class="comment +" data-comment-id="\d+">.*?<div class="actions-wrap">.*?<div class="name">\s+<a href="/users/(([a-zA-Z0-9]|-|_)+)">(([a-zA-Z0-9]|-|_|\*)+)</a>\s+</div>\s+<div class="content">(.*?)</div>%ms', $data, $matches);
|
||||||
unset($matches[2]);
|
unset($matches[2]);
|
||||||
unset($matches[3]);
|
unset($matches[3]);
|
||||||
unset($matches[4]);
|
unset($matches[4]);
|
||||||
foreach ($matches[5] as $key => $val) {
|
foreach ($matches[5] as $key => $val) {
|
||||||
$user = $matches[1][$key];
|
$user = $matches[1][$key];
|
||||||
$comment = trim($val);
|
$comment = trim($val);
|
||||||
if (strtolower($user) == strtolower(htmlspecialchars($this->userName)) && $this->stringContainsArray($comment, $codes)) {
|
if ((strtolower($user) == strtolower(htmlspecialchars($this->userName)) && $this->stringContainsArray($comment, $codes)) {
|
||||||
$success = true;
|
$success = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue