mirror of
https://github.com/openvk/openvk
synced 2025-04-23 16:43:02 +03:00
Compare commits
1 commit
c8a37b3051
...
31db422578
Author | SHA1 | Date | |
---|---|---|---|
31db422578 |
2 changed files with 5 additions and 9 deletions
|
@ -7,7 +7,6 @@ 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
|
||||||
|
@ -63,11 +62,10 @@ 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();
|
||||||
} elseif ($this->isDomainBanned($link->getDomain())) {
|
else if ($this->isDomainBanned($link->getDomain()))
|
||||||
yield $link->getId();
|
yield $link->getId();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,10 @@ 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