fixed regex after API format changed

This commit is contained in:
Jacob G 2015-04-26 10:39:16 -04:00
parent 979d8ac685
commit aab7aa3caa

View file

@ -112,8 +112,11 @@ class AccountRequestSubmission {
return;
}
$success = false;
preg_match_all('%<div id="comments-\d+" class="comment +" data-comment-id="\d+">.*?<a href="/users/(.*?)">.*?<div class="content">(.*?)</div>%ms', $data, $matches);
foreach ($matches[2] as $key => $val) {
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[3]);
unset($matches[4]);
foreach ($matches[5] as $key => $val) {
$user = $matches[1][$key];
$comment = trim($val);
if (strtolower($user) == strtolower(htmlspecialchars($this->userName)) && $this->stringContainsArray($comment, $codes)) {