filter non-ascii domains
This commit is contained in:
parent
9341c408b9
commit
ba20d8d5af
@ -68,6 +68,17 @@ class Rule34 extends Extension
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onSourceSet(SourceSetEvent $event)
|
||||||
|
{
|
||||||
|
// Maybe check for 404?
|
||||||
|
if (empty($event->source)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!preg_match("/^(https?:\/\/)?[a-zA-Z0-9\.\-]+(\/.*)?$/", $event->source)) {
|
||||||
|
throw new SCoreException("Invalid source URL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function onPageRequest(PageRequestEvent $event)
|
public function onPageRequest(PageRequestEvent $event)
|
||||||
{
|
{
|
||||||
global $database, $page, $user;
|
global $database, $page, $user;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user