File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,14 @@ const LoginScreen = {
266266 }
267267
268268 else if ( this . index . currentIndex === 1 && this . details . name . length > 0 ) { // name
269+ // Validate username - check for HTML characters
270+ const htmlChars = / [ < > & " ' ] / ;
271+ if ( htmlChars . test ( this . details . name ) ) {
272+ this . warning . show = true ;
273+ this . warning . text = this . $t ( "InvalidName" ) ;
274+ this . isLoading = false ;
275+ return ;
276+ }
269277 if ( sugarizer . getClientType ( ) === sugarizer . constant . webAppType || this . details . serverAddress . length > 0 ) {
270278 const info = await sugarizer . modules . server . getServerInformation ( this . details . serverAddress ) ;
271279 this . consentNeed = info . options [ 'consent-need' ] ;
Original file line number Diff line number Diff line change @@ -201,6 +201,13 @@ const AboutMe = {
201201 this . close ( 'about_me' ) ;
202202 return ;
203203 }
204+ // Validate username - check for HTML characters
205+ const htmlChars = / [ < > & " ' ] / ;
206+ if ( htmlChars . test ( this . name ) ) {
207+ this . warning . show = true ;
208+ this . warning . text = this . $t ( 'InvalidName' ) ;
209+ return ;
210+ }
204211 if ( nameChanged && await sugarizer . modules . user . checkIfExists ( null , this . name ) ) {
205212 this . warning . show = true ;
206213 this . warning . text = this . $t ( 'UserAlreadyExist' ) ;
You can’t perform that action at this time.
0 commit comments