RestrictedNames.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?php
  2. namespace App\Util\Lexer;
  3. class RestrictedNames
  4. {
  5. public static $additional = [
  6. 'autoconfig',
  7. 'blog',
  8. 'broadcasthost',
  9. 'copyright',
  10. 'download',
  11. 'domainadmin',
  12. 'domainadministrator',
  13. 'errors',
  14. 'events',
  15. 'example',
  16. 'faq',
  17. 'faqs',
  18. 'features',
  19. 'ftp',
  20. 'guest',
  21. 'guests',
  22. 'hostmaster',
  23. 'hostmaster',
  24. 'imap',
  25. 'info',
  26. 'information',
  27. 'is',
  28. 'isatap',
  29. 'it',
  30. 'localdomain',
  31. 'localhost',
  32. 'mail',
  33. 'mailer-daemon',
  34. 'mailerdaemon',
  35. 'marketing',
  36. 'me',
  37. 'mis',
  38. 'mx',
  39. 'no-reply',
  40. 'nobody',
  41. 'noc',
  42. 'noreply',
  43. 'ns0',
  44. 'ns1',
  45. 'ns2',
  46. 'ns3',
  47. 'ns4',
  48. 'ns5',
  49. 'ns6',
  50. 'ns7',
  51. 'ns8',
  52. 'ns9',
  53. 'owner',
  54. 'pop',
  55. 'pop3',
  56. 'postmaster',
  57. 'pricing',
  58. 'root',
  59. 'sales',
  60. 'security',
  61. 'signin',
  62. 'signout',
  63. 'smtp',
  64. 'src',
  65. 'ssladmin',
  66. 'ssladministrator',
  67. 'sslwebmaster',
  68. 'sys',
  69. 'sysadmin',
  70. 'system',
  71. 'tutorial',
  72. 'tutorials',
  73. 'usenet',
  74. 'uucp',
  75. 'webmaster',
  76. 'wpad',
  77. ];
  78. public static $reserved = [
  79. // Reserved for instance admin
  80. 'admin',
  81. 'administrator',
  82. // Static Assets
  83. 'assets',
  84. 'public',
  85. 'storage',
  86. 'htaccess',
  87. '.htaccess',
  88. 'favicon.ico',
  89. 'embed.js',
  90. 'index.php',
  91. 'manifest.json',
  92. 'mix-manifest.json',
  93. 'robots.txt',
  94. // Laravel Horizon
  95. 'horizon',
  96. // Reserved routes
  97. 'a',
  98. 'app',
  99. 'about',
  100. 'aboutus',
  101. 'about-us',
  102. 'abuse',
  103. 'actor',
  104. 'actors',
  105. 'account',
  106. 'admins',
  107. 'api',
  108. 'audio',
  109. 'auth',
  110. 'avatar',
  111. 'avatars',
  112. 'b',
  113. 'bartender',
  114. 'broadcast',
  115. 'broadcaster',
  116. 'booth',
  117. 'bouncer',
  118. 'c',
  119. 'cdn',
  120. 'circle',
  121. 'circles',
  122. 'checkpoint',
  123. 'collection',
  124. 'collections',
  125. 'community',
  126. 'communities',
  127. 'contact',
  128. 'contact-us',
  129. 'contact_us',
  130. 'costar',
  131. 'costars',
  132. 'css',
  133. 'd',
  134. 'dashboard',
  135. 'dmca',
  136. 'db',
  137. 'deck',
  138. 'dev',
  139. 'developer',
  140. 'developers',
  141. 'discover',
  142. 'discovers',
  143. 'dj',
  144. 'doc',
  145. 'docs',
  146. 'docs',
  147. 'drive',
  148. 'drives',
  149. 'driver',
  150. 'e',
  151. 'embed',
  152. 'email',
  153. 'emails',
  154. 'emoji',
  155. 'emojis',
  156. 'error',
  157. 'explore',
  158. 'export',
  159. 'exports',
  160. 'f',
  161. 'feed',
  162. 'font',
  163. 'fonts',
  164. 'follow',
  165. 'follows',
  166. 'followme',
  167. 'follow-me',
  168. 'follow_me',
  169. 'g',
  170. 'gdpr',
  171. 'graph',
  172. 'ghost',
  173. 'ghosts',
  174. 'group',
  175. 'groups',
  176. 'h',
  177. 'header',
  178. 'headers',
  179. 'home',
  180. 'help',
  181. 'helpcenter',
  182. 'help-center',
  183. 'help_center',
  184. 'help_center_',
  185. 'help-center-',
  186. 'help-center_',
  187. 'help_center-',
  188. 'i',
  189. 'instance',
  190. 'inbox',
  191. 'img',
  192. 'imgs',
  193. 'image',
  194. 'images',
  195. 'invite',
  196. 'invites',
  197. 'import',
  198. 'imports',
  199. 'j',
  200. 'js',
  201. 'k',
  202. 'key',
  203. 'l',
  204. 'lang',
  205. 'language',
  206. '_lang',
  207. '_language',
  208. 'lab',
  209. 'labs',
  210. 'legal',
  211. 'live',
  212. 'loop',
  213. 'loops',
  214. 'location',
  215. 'locations',
  216. 'login',
  217. 'logout',
  218. 'm',
  219. 'media',
  220. 'menu',
  221. 'music',
  222. 'my2020',
  223. 'my2021',
  224. 'my2022',
  225. 'my2023',
  226. 'my2024',
  227. 'my2025',
  228. 'my2026',
  229. 'my2027',
  230. 'my2028',
  231. 'my2029',
  232. 'my2030',
  233. 'n',
  234. 'news',
  235. 'new',
  236. 'news',
  237. 'news',
  238. 'newsfeed',
  239. 'newsroom',
  240. 'newsrooms',
  241. 'news-room',
  242. 'news-rooms',
  243. 'o',
  244. 'oauth',
  245. 'official',
  246. 'p',
  247. 'page',
  248. 'pages',
  249. 'pin',
  250. 'pins',
  251. 'photo',
  252. 'photos',
  253. 'password',
  254. 'privacy',
  255. 'private',
  256. 'q',
  257. 'quote',
  258. 'query',
  259. 'r',
  260. 'redirect',
  261. 'redirects',
  262. 'register',
  263. 'registers',
  264. 'review',
  265. 'reset',
  266. 'report',
  267. 'results',
  268. 'reports',
  269. 'robot',
  270. 'robots',
  271. 's',
  272. 'sc',
  273. 'search',
  274. 'sell',
  275. 'send',
  276. 'settings',
  277. 'short',
  278. 'shortcode',
  279. 'status',
  280. 'statuses',
  281. 'site',
  282. 'sites',
  283. 'stage',
  284. 'static',
  285. 'story',
  286. 'stories',
  287. 'support',
  288. 'svg',
  289. 'svgs',
  290. 't',
  291. 'terms',
  292. 'telescope',
  293. 'timeline',
  294. 'timelines',
  295. 'tour',
  296. 'tv',
  297. 'u',
  298. 'user',
  299. 'users',
  300. 'username',
  301. 'usernames',
  302. 'v',
  303. 'valet',
  304. 'video',
  305. 'videos',
  306. 'vendor',
  307. 'w',
  308. 'waiter',
  309. 'wall',
  310. 'whats-new',
  311. 'whatsnew',
  312. 'whatnew',
  313. 'whats-news',
  314. 'web',
  315. 'ws',
  316. 'wss',
  317. 'www',
  318. 'x',
  319. 'y',
  320. 'z',
  321. '400',
  322. '401',
  323. '403',
  324. '404',
  325. '500',
  326. '503',
  327. '504',
  328. ];
  329. public static function get()
  330. {
  331. $banned = [];
  332. if(config('instance.username.banned')) {
  333. $banned = array_map('trim', explode(',', config('instance.username.banned')));
  334. }
  335. $additional = self::$additional;
  336. $reserved = self::$reserved;
  337. $res = array_merge($additional, $reserved, $banned);
  338. $res = array_unique($res);
  339. sort($res);
  340. return $res;
  341. }
  342. }