2018-04-29 16:27:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Util\Lexer;
|
|
|
|
|
|
|
|
class RestrictedNames {
|
|
|
|
|
2018-05-23 00:45:13 +00:00
|
|
|
static $blacklist = [
|
2018-04-29 16:27:15 +00:00
|
|
|
"about",
|
|
|
|
"abuse",
|
|
|
|
"administrator",
|
|
|
|
"app",
|
|
|
|
"autoconfig",
|
|
|
|
"blog",
|
|
|
|
"broadcasthost",
|
|
|
|
"community",
|
|
|
|
"contact",
|
|
|
|
"contact-us",
|
|
|
|
"contact_us",
|
|
|
|
"copyright",
|
|
|
|
"d",
|
|
|
|
"dashboard",
|
|
|
|
"dev",
|
|
|
|
"developer",
|
|
|
|
"developers",
|
2018-05-12 02:21:56 +00:00
|
|
|
"discover",
|
|
|
|
"discovers",
|
2018-04-29 16:27:15 +00:00
|
|
|
"doc",
|
|
|
|
"docs",
|
|
|
|
"download",
|
|
|
|
"domainadmin",
|
|
|
|
"domainadministrator",
|
|
|
|
"email",
|
|
|
|
"errors",
|
|
|
|
"events",
|
|
|
|
"example",
|
|
|
|
"faq",
|
|
|
|
"faqs",
|
|
|
|
"features",
|
|
|
|
"ftp",
|
|
|
|
"guest",
|
|
|
|
"guests",
|
|
|
|
"help",
|
|
|
|
"hostmaster",
|
|
|
|
"hostmaster",
|
|
|
|
"image",
|
|
|
|
"images",
|
|
|
|
"imap",
|
|
|
|
"img",
|
|
|
|
"info",
|
|
|
|
"info",
|
|
|
|
"is",
|
|
|
|
"isatap",
|
|
|
|
"it",
|
|
|
|
"localdomain",
|
|
|
|
"localhost",
|
|
|
|
"mail",
|
|
|
|
"mailer-daemon",
|
|
|
|
"mailerdaemon",
|
|
|
|
"marketing",
|
|
|
|
"me",
|
|
|
|
"media",
|
|
|
|
"mis",
|
|
|
|
"mx",
|
|
|
|
"new",
|
|
|
|
"news",
|
|
|
|
"news",
|
|
|
|
"no-reply",
|
|
|
|
"nobody",
|
|
|
|
"noc",
|
|
|
|
"noreply",
|
|
|
|
"ns0",
|
|
|
|
"ns1",
|
|
|
|
"ns2",
|
|
|
|
"ns3",
|
|
|
|
"ns4",
|
|
|
|
"ns5",
|
|
|
|
"ns6",
|
|
|
|
"ns7",
|
|
|
|
"ns8",
|
|
|
|
"ns9",
|
|
|
|
"owner",
|
|
|
|
"pop",
|
|
|
|
"pop3",
|
|
|
|
"postmaster",
|
|
|
|
"pricing",
|
|
|
|
"privacy",
|
|
|
|
"root",
|
|
|
|
"sales",
|
|
|
|
"security",
|
|
|
|
"signin",
|
|
|
|
"signout",
|
|
|
|
"smtp",
|
|
|
|
"src",
|
|
|
|
"ssladmin",
|
|
|
|
"ssladministrator",
|
|
|
|
"sslwebmaster",
|
|
|
|
"status",
|
|
|
|
"support",
|
|
|
|
"support",
|
|
|
|
"sys",
|
|
|
|
"sysadmin",
|
|
|
|
"system",
|
|
|
|
"terms",
|
|
|
|
"tutorial",
|
|
|
|
"tutorials",
|
|
|
|
"usenet",
|
|
|
|
"uucp",
|
|
|
|
"webmaster",
|
|
|
|
"wpad",
|
|
|
|
"www"
|
|
|
|
];
|
|
|
|
|
2018-05-23 00:45:13 +00:00
|
|
|
static $reserved = [
|
|
|
|
// Reserved for instance admin
|
|
|
|
"admin",
|
|
|
|
|
|
|
|
// Static Assets
|
|
|
|
"assets",
|
2018-08-05 19:24:23 +00:00
|
|
|
"storage",
|
2018-05-23 00:45:13 +00:00
|
|
|
|
|
|
|
// Laravel Horizon
|
|
|
|
"horizon",
|
|
|
|
|
2018-06-01 19:57:31 +00:00
|
|
|
// Reserved routes
|
|
|
|
"account",
|
|
|
|
"api",
|
|
|
|
"auth",
|
2018-08-16 09:15:13 +00:00
|
|
|
"css",
|
|
|
|
"c",
|
2018-05-23 00:45:13 +00:00
|
|
|
"i",
|
2018-08-05 19:24:23 +00:00
|
|
|
"dashboard",
|
2018-08-16 09:15:13 +00:00
|
|
|
"deck",
|
2018-06-01 19:57:31 +00:00
|
|
|
"discover",
|
2018-08-05 19:24:23 +00:00
|
|
|
"docs",
|
2018-08-16 09:15:13 +00:00
|
|
|
"fonts",
|
2018-06-01 19:57:31 +00:00
|
|
|
"home",
|
2018-08-16 09:15:13 +00:00
|
|
|
"img",
|
|
|
|
"js",
|
2018-06-01 19:57:31 +00:00
|
|
|
"login",
|
|
|
|
"logout",
|
2018-08-05 19:24:23 +00:00
|
|
|
"media",
|
2018-06-01 19:57:31 +00:00
|
|
|
"p",
|
|
|
|
"password",
|
2018-08-16 09:15:13 +00:00
|
|
|
"report",
|
2018-08-05 19:24:23 +00:00
|
|
|
"reports",
|
2018-06-01 19:57:31 +00:00
|
|
|
"search",
|
|
|
|
"settings",
|
2018-08-05 19:24:23 +00:00
|
|
|
"statuses",
|
2018-06-01 19:57:31 +00:00
|
|
|
"site",
|
2018-08-16 09:15:13 +00:00
|
|
|
"sites",
|
2018-06-01 19:57:31 +00:00
|
|
|
"timeline",
|
2018-08-16 09:15:13 +00:00
|
|
|
"timelines",
|
|
|
|
"tour",
|
2018-06-01 19:57:31 +00:00
|
|
|
"user",
|
|
|
|
"users",
|
2018-08-16 09:15:13 +00:00
|
|
|
"vendor",
|
2018-08-10 23:29:09 +00:00
|
|
|
"400",
|
|
|
|
"401",
|
|
|
|
"403",
|
|
|
|
"404",
|
|
|
|
"500",
|
|
|
|
"503",
|
|
|
|
"504",
|
2018-05-23 00:45:13 +00:00
|
|
|
];
|
|
|
|
|
2018-04-29 16:27:15 +00:00
|
|
|
public static function get()
|
|
|
|
{
|
2018-05-23 00:45:13 +00:00
|
|
|
|
|
|
|
$reserved = $blacklist = [];
|
|
|
|
|
|
|
|
if(true == config('pixelfed.restricted_names.use_blacklist')) {
|
|
|
|
$blacklist = self::$blacklist;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(true == config('pixelfed.restricted_names.reserved_routes')) {
|
|
|
|
$reserved = self::$reserved;
|
|
|
|
}
|
|
|
|
return array_merge($blacklist, $reserved);
|
2018-04-29 16:27:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|