Browse Source

Update RegisterController

Daniel Supernault 4 years ago
parent
commit
3b7ff030f2

+ 4 - 0
app/Http/Controllers/Auth/RegisterController.php

@@ -68,6 +68,10 @@ class RegisterController extends Controller
                 $underscore = substr_count($value, '_');
                 $period = substr_count($value, '.');
 
+                if(ends_with($value, ['.php', '.js', '.css'])) {
+                    return $fail('Username is invalid.');
+                }
+
                 if(($dash + $underscore + $period) > 1) {
                     return $fail('Username is invalid. Can only contain one dash (-), period (.) or underscore (_).');
                 }

+ 5 - 0
app/Util/Lexer/RestrictedNames.php

@@ -85,6 +85,7 @@ class RestrictedNames
 
 		// Static Assets
 		'assets',
+		'public',
 		'storage',
 
 		// Laravel Horizon
@@ -141,6 +142,8 @@ class RestrictedNames
 		'drives',
 		'driver',
 		'e',
+		'embed',
+		'embed.js',
 		'email',
 		'emails',
 		'error',
@@ -182,6 +185,7 @@ class RestrictedNames
 		'invites',
 		'import',
 		'imports',
+		'index.php',
 		'j',
 		'js',
 		'k',
@@ -280,6 +284,7 @@ class RestrictedNames
 		'whatsnew',
 		'whatnew',
 		'whats-news',
+		'web',
 		'ws',
 		'wss',
 		'www',