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 Chandler\Database\DatabaseConnection as DB;
|
||||||
use Nette\Database\Table\{ActiveRow, Selection};
|
use Nette\Database\Table\{ActiveRow, Selection};
|
||||||
use openvk\Web\Models\Entities\BannedLink;
|
use openvk\Web\Models\Entities\BannedLink;
|
||||||
|
|
||||||
use function Symfony\Component\Translation\t;
|
use function Symfony\Component\Translation\t;
|
||||||
|
|
||||||
class BannedLinks
|
class BannedLinks
|
||||||
|
@ -62,10 +63,11 @@ 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()))
|
} elseif ($this->isDomainBanned($link->getDomain())) {
|
||||||
yield $link->getId();
|
yield $link->getId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,12 @@ final class AwayPresenter extends OpenVKPresenter
|
||||||
{
|
{
|
||||||
public function renderAway(): void
|
public function renderAway(): void
|
||||||
{
|
{
|
||||||
$checkBanEntries = (new BannedLinks)->check($this->queryParam("to"));
|
$checkBanEntries = (new BannedLinks())->check($this->queryParam("to"));
|
||||||
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");
|
||||||
|
|
Loading…
Reference in a new issue