1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-27 10:16:47 +00:00
pixelfed/app/Util/Lexer/RestrictedNames.php

183 lines
2.8 KiB
PHP
Raw Normal View History

2018-04-29 16:27:15 +00:00
<?php
namespace App\Util\Lexer;
2018-08-28 03:07:36 +00:00
class RestrictedNames
{
public static $blacklist = [
'about',
'abuse',
'administrator',
'app',
'autoconfig',
'blog',
'broadcasthost',
'community',
'contact',
'contact-us',
'contact_us',
'copyright',
'd',
'dashboard',
'dev',
'developer',
'developers',
'discover',
'discovers',
'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-04-29 16:27:15 +00:00
];
2018-08-28 03:07:36 +00:00
public static $reserved = [
2018-05-23 00:45:13 +00:00
// Reserved for instance admin
2018-08-28 03:07:36 +00:00
'admin',
2018-09-16 05:15:45 +00:00
'administrator',
2018-05-23 00:45:13 +00:00
// Static Assets
2018-08-28 03:07:36 +00:00
'assets',
'storage',
2018-05-23 00:45:13 +00:00
// Laravel Horizon
2018-08-28 03:07:36 +00:00
'horizon',
2018-05-23 00:45:13 +00:00
// Reserved routes
2018-08-28 03:07:36 +00:00
'account',
'api',
'auth',
'css',
2018-09-16 05:15:45 +00:00
'checkpoint',
2018-08-28 03:07:36 +00:00
'c',
'i',
'dashboard',
'deck',
'discover',
'docs',
'fonts',
'home',
'img',
'js',
'login',
'logout',
'media',
'p',
'password',
'report',
'reports',
'search',
'settings',
'statuses',
'site',
'sites',
'timeline',
'timelines',
'tour',
'user',
'users',
'vendor',
'400',
'401',
'403',
'404',
'500',
'503',
'504',
2018-05-23 00:45:13 +00:00
];
2018-08-28 03:07:36 +00:00
public static function get()
{
$reserved = $blacklist = [];
2018-05-23 00:45:13 +00:00
2018-08-28 03:07:36 +00:00
if (true == config('pixelfed.restricted_names.use_blacklist')) {
$blacklist = self::$blacklist;
}
2018-05-23 00:45:13 +00:00
2018-08-28 03:07:36 +00:00
if (true == config('pixelfed.restricted_names.reserved_routes')) {
$reserved = self::$reserved;
}
2018-04-29 16:27:15 +00:00
2018-08-28 03:07:36 +00:00
return array_merge($blacklist, $reserved);
}
}