mirror of
https://github.com/openvk/openvk
synced 2025-02-23 20:30:30 +03:00
style: fixes (#1237)
This commit is contained in:
parent
ee0dd8c749
commit
cb14085cd4
2 changed files with 9 additions and 5 deletions
|
@ -7,6 +7,7 @@ namespace openvk\Web\Models\Repositories;
|
|||
use Chandler\Database\DatabaseConnection as DB;
|
||||
use Nette\Database\Table\{ActiveRow, Selection};
|
||||
use openvk\Web\Models\Entities\BannedLink;
|
||||
|
||||
use function Symfony\Component\Translation\t;
|
||||
|
||||
class BannedLinks
|
||||
|
@ -62,10 +63,11 @@ class BannedLinks
|
|||
public function genEntries($links, $uri): \Traversable
|
||||
{
|
||||
foreach ($links as $link) {
|
||||
if (preg_match($link->getRegexpRule(), $uri))
|
||||
if (preg_match($link->getRegexpRule(), $uri)) {
|
||||
yield $link->getId();
|
||||
else if ($this->isDomainBanned($link->getDomain()))
|
||||
} elseif ($this->isDomainBanned($link->getDomain())) {
|
||||
yield $link->getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,12 @@ final class AwayPresenter extends OpenVKPresenter
|
|||
{
|
||||
public function renderAway(): void
|
||||
{
|
||||
$checkBanEntries = (new BannedLinks)->check($this->queryParam("to"));
|
||||
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["susLinks"]["warnings"])
|
||||
if (sizeof($checkBanEntries) > 0)
|
||||
$checkBanEntries = (new BannedLinks())->check($this->queryParam("to"));
|
||||
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["susLinks"]["warnings"]) {
|
||||
if (sizeof($checkBanEntries) > 0) {
|
||||
$this->pass("openvk!Away->view", $checkBanEntries[0]);
|
||||
}
|
||||
}
|
||||
|
||||
header("HTTP/1.0 302 Found");
|
||||
header("X-Robots-Tag: noindex, nofollow, noarchive");
|
||||
|
|
Loading…
Reference in a new issue