fix(away.php): syntax

This commit is contained in:
veselcraft 2025-02-16 16:43:37 +03:00
parent 2e8cb81970
commit 267918252c
No known key found for this signature in database
GPG key ID: 9CF0B42766CCF7BA
2 changed files with 2 additions and 3 deletions

View file

@ -62,11 +62,12 @@ class BannedLinks
public function genEntries($links, $uri): \Traversable public function genEntries($links, $uri): \Traversable
{ {
foreach ($links as $link) { foreach ($links as $link) {
if (preg_match($link->getRegexpRule(), $uri)) { if (preg_match($link->getRegexpRule(), $uri))
yield $link->getId(); yield $link->getId();
else if ($this->isDomainBanned($link->getDomain())) else if ($this->isDomainBanned($link->getDomain()))
yield $link->getId(); yield $link->getId();
} }
}
public function check(string $url): ?array public function check(string $url): ?array
{ {

View file

@ -15,8 +15,6 @@ final class AwayPresenter extends OpenVKPresenter
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["susLinks"]["warnings"]) if (OPENVK_ROOT_CONF["openvk"]["preferences"]["susLinks"]["warnings"])
if (sizeof($checkBanEntries) > 0) if (sizeof($checkBanEntries) > 0)
$this->pass("openvk!Away->view", $checkBanEntries[0]); $this->pass("openvk!Away->view", $checkBanEntries[0]);
}
}
header("HTTP/1.0 302 Found"); header("HTTP/1.0 302 Found");
header("X-Robots-Tag: noindex, nofollow, noarchive"); header("X-Robots-Tag: noindex, nofollow, noarchive");