Skip to content

Commit

Permalink
style: fixes (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
WerySkok authored Feb 22, 2025
1 parent ee0dd8c commit cb14085
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Web/Models/Repositories/BannedLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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
Expand Down Expand Up @@ -62,10 +63,11 @@ public function genLinks($rules): \Traversable
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();
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions Web/Presenters/AwayPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit cb14085

Please sign in to comment.