1
0
Fork 0
pixelfed/app/Util/Lexer/RestrictedNames.php

310 lines
4.6 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 = [
'autoconfig',
'blog',
'broadcasthost',
'copyright',
'download',
'domainadmin',
'domainadministrator',
'errors',
'events',
'example',
'faq',
'faqs',
'features',
'ftp',
'guest',
'guests',
'hostmaster',
'hostmaster',
'imap',
'info',
2019-12-31 23:52:17 +00:00
'information',
2018-08-28 03:07:36 +00:00
'is',
'isatap',
'it',
'localdomain',
'localhost',
'mail',
'mailer-daemon',
'mailerdaemon',
'marketing',
'me',
'mis',
'mx',
'no-reply',
'nobody',
'noc',
'noreply',
'ns0',
'ns1',
'ns2',
'ns3',
'ns4',
'ns5',
'ns6',
'ns7',
'ns8',
'ns9',
'owner',
'pop',
'pop3',
'postmaster',
'pricing',
'root',
'sales',
'security',
'signin',
'signout',
'smtp',
'src',
'ssladmin',
'ssladministrator',
'sslwebmaster',
'sys',
'sysadmin',
'system',
'tutorial',
'tutorials',
'usenet',
'uucp',
'webmaster',
'wpad',
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
2019-05-02 04:54:29 +00:00
'a',
2019-07-23 04:39:36 +00:00
'app',
'about',
2019-12-11 06:04:03 +00:00
'aboutus',
'about-us',
2019-07-23 04:39:36 +00:00
'abuse',
2018-08-28 03:07:36 +00:00
'account',
2019-07-23 04:39:36 +00:00
'admins',
2018-08-28 03:07:36 +00:00
'api',
2019-05-02 04:54:29 +00:00
'audio',
2018-08-28 03:07:36 +00:00
'auth',
2019-05-02 04:54:29 +00:00
'b',
2019-01-22 02:59:25 +00:00
'bartender',
2018-12-29 03:39:16 +00:00
'broadcast',
'broadcaster',
2019-01-22 02:59:25 +00:00
'booth',
'bouncer',
'c',
2019-06-05 03:47:25 +00:00
'cdn',
2019-05-02 04:54:29 +00:00
'circle',
'circles',
2018-09-16 05:15:45 +00:00
'checkpoint',
2018-12-29 03:39:16 +00:00
'collection',
'collections',
2019-06-05 03:47:25 +00:00
'community',
'communities',
'contact',
'contact-us',
'contact_us',
2019-01-22 02:59:25 +00:00
'costar',
'costars',
2019-06-05 03:47:25 +00:00
'css',
2019-01-22 02:59:25 +00:00
'd',
2018-08-28 03:07:36 +00:00
'dashboard',
2019-07-23 04:39:36 +00:00
'dmca',
2019-06-05 03:47:25 +00:00
'db',
2018-08-28 03:07:36 +00:00
'deck',
2019-01-22 02:59:25 +00:00
'dev',
'developer',
'developers',
2018-08-28 03:07:36 +00:00
'discover',
2019-01-22 02:59:25 +00:00
'discovers',
'dj',
'doc',
2018-08-28 03:07:36 +00:00
'docs',
2019-01-22 02:59:25 +00:00
'docs',
'drive',
2019-07-23 04:39:36 +00:00
'drives',
2019-01-22 02:59:25 +00:00
'driver',
2019-07-23 04:39:36 +00:00
'e',
2019-12-31 23:52:17 +00:00
'email',
'emails',
2018-12-29 03:39:16 +00:00
'error',
'explore',
2019-07-23 04:39:36 +00:00
'export',
'exports',
'f',
2019-05-02 04:54:29 +00:00
'feed',
2019-01-22 02:59:25 +00:00
'font',
2018-08-28 03:07:36 +00:00
'fonts',
2019-07-23 04:39:36 +00:00
'follow',
'follows',
'followme',
'follow-me',
'follow_me',
2019-05-02 04:54:29 +00:00
'g',
2019-01-22 02:59:25 +00:00
'gdpr',
2019-06-05 03:47:25 +00:00
'graph',
2019-07-23 04:39:36 +00:00
'ghost',
'ghosts',
2019-05-02 04:54:29 +00:00
'group',
'groups',
2019-06-05 03:47:25 +00:00
'h',
2018-08-28 03:07:36 +00:00
'home',
2018-12-29 03:39:16 +00:00
'help',
'helpcenter',
2019-01-22 02:59:25 +00:00
'help-center',
'help_center',
'help_center_',
'help-center-',
'help-center_',
'help_center-',
2018-12-29 03:39:16 +00:00
'i',
2018-08-28 03:07:36 +00:00
'img',
2019-01-22 02:59:25 +00:00
'imgs',
'image',
'images',
2019-02-15 03:50:14 +00:00
'invite',
'invites',
2019-07-23 04:39:36 +00:00
'import',
'imports',
'j',
2018-08-28 03:07:36 +00:00
'js',
2019-07-23 04:39:36 +00:00
'k',
'key',
2019-06-05 03:47:25 +00:00
'l',
2019-02-15 03:50:14 +00:00
'lab',
'labs',
2019-01-22 02:59:25 +00:00
'legal',
2018-12-29 03:39:16 +00:00
'live',
2019-06-05 03:47:25 +00:00
'loop',
'loops',
'location',
'locations',
2018-08-28 03:07:36 +00:00
'login',
'logout',
2019-05-02 04:54:29 +00:00
'm',
2018-08-28 03:07:36 +00:00
'media',
2019-01-22 02:59:25 +00:00
'menu',
2019-05-02 04:54:29 +00:00
'music',
'n',
'news',
'new',
'news',
'news',
'newsfeed',
2019-12-31 23:52:17 +00:00
'newsroom',
'newsrooms',
'news-room',
'news-rooms',
2019-07-23 04:39:36 +00:00
'o',
2019-01-31 21:00:39 +00:00
'oauth',
2018-12-29 03:39:16 +00:00
'official',
2018-08-28 03:07:36 +00:00
'p',
2019-01-31 21:00:39 +00:00
'page',
'pages',
2019-06-05 03:47:25 +00:00
'pin',
'pins',
2019-01-22 02:59:25 +00:00
'photo',
'photos',
2018-08-28 03:07:36 +00:00
'password',
2019-01-22 02:59:25 +00:00
'privacy',
2019-07-23 04:39:36 +00:00
'private',
'q',
'quote',
'query',
'r',
2019-08-09 20:09:54 +00:00
'register',
'registers',
2019-07-23 04:39:36 +00:00
'review',
2018-12-29 03:39:16 +00:00
'reset',
2018-08-28 03:07:36 +00:00
'report',
2019-02-22 19:31:09 +00:00
'results',
2018-08-28 03:07:36 +00:00
'reports',
2018-12-29 03:39:16 +00:00
'robot',
'robots',
2019-07-23 04:39:36 +00:00
's',
2018-08-28 03:07:36 +00:00
'search',
2019-07-23 04:39:36 +00:00
'sell',
2018-12-29 03:39:16 +00:00
'send',
2018-08-28 03:07:36 +00:00
'settings',
2018-12-29 03:39:16 +00:00
'status',
2018-08-28 03:07:36 +00:00
'statuses',
'site',
'sites',
2019-01-22 02:59:25 +00:00
'stage',
2018-12-29 03:39:16 +00:00
'static',
'story',
'stories',
'support',
2019-01-22 02:59:25 +00:00
'svg',
'svgs',
2019-07-23 04:39:36 +00:00
't',
2019-01-22 02:59:25 +00:00
'terms',
2018-12-29 03:39:16 +00:00
'telescope',
2018-08-28 03:07:36 +00:00
'timeline',
'timelines',
'tour',
2019-06-05 03:47:25 +00:00
'tv',
2019-07-23 04:39:36 +00:00
'u',
2018-08-28 03:07:36 +00:00
'user',
'users',
2019-01-04 06:07:54 +00:00
'username',
'usernames',
2019-05-02 04:54:29 +00:00
'v',
2019-07-23 04:39:36 +00:00
'valet',
2019-05-02 04:54:29 +00:00
'video',
'videos',
2018-08-28 03:07:36 +00:00
'vendor',
2019-07-23 04:39:36 +00:00
'w',
2019-01-22 02:59:25 +00:00
'waiter',
2019-05-02 04:54:29 +00:00
'wall',
'whats-new',
'whatsnew',
'whatnew',
2019-05-02 18:21:36 +00:00
'whats-news',
2018-12-29 03:39:16 +00:00
'ws',
'wss',
'www',
2019-07-23 04:39:36 +00:00
'x',
'y',
'z',
2018-08-28 03:07:36 +00:00
'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);
}
}