From d613e7239acaa02e5a03c07141bddf01deebe197 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Fri, 8 May 2020 22:41:24 +0000 Subject: [PATCH] Fix Jubeat name entry regex to allow for spaces like the in-game name entry does. --- bemani/frontend/jubeat/endpoints.py | 2 +- bemani/frontend/static/controllers/jubeat/rivals.react.js | 2 +- bemani/frontend/static/controllers/jubeat/settings.react.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bemani/frontend/jubeat/endpoints.py b/bemani/frontend/jubeat/endpoints.py index 2e0b583..1e52e14 100644 --- a/bemani/frontend/jubeat/endpoints.py +++ b/bemani/frontend/jubeat/endpoints.py @@ -328,7 +328,7 @@ def updatename() -> Dict[str, Any]: raise Exception('Unable to find profile to update!') if len(name) == 0 or len(name) > 8: raise Exception('Invalid profile name!') - if re.match(r'^[-&\.\*A-Z0-9]*$', name) is None: + if re.match(r'^[ -&\.\*A-Z0-9]*$', name) is None: raise Exception('Invalid profile name!') profile.replace_str('name', name) g.data.local.user.put_profile(GameConstants.JUBEAT, version, user.id, profile) diff --git a/bemani/frontend/static/controllers/jubeat/rivals.react.js b/bemani/frontend/static/controllers/jubeat/rivals.react.js index f9746fd..32c1e66 100644 --- a/bemani/frontend/static/controllers/jubeat/rivals.react.js +++ b/bemani/frontend/static/controllers/jubeat/rivals.react.js @@ -165,7 +165,7 @@ var rivals_view = React.createClass({ value={this.state.term} onChange={function(event) { var value = event.target.value.toUpperCase(); - var intRegex = /^[-&\\.\\*A-Z0-9]*$/; + var intRegex = /^[ -&\\.\\*A-Z0-9]*$/; // Normally, names are <= 8 characters, but we allow Jubeat IDs here too if (value.length <= 9 && intRegex.test(value)) { this.setState({term: value}); diff --git a/bemani/frontend/static/controllers/jubeat/settings.react.js b/bemani/frontend/static/controllers/jubeat/settings.react.js index 3fc49ca..6dda8e4 100644 --- a/bemani/frontend/static/controllers/jubeat/settings.react.js +++ b/bemani/frontend/static/controllers/jubeat/settings.react.js @@ -73,7 +73,7 @@ var settings_view = React.createClass({ value={this.state.new_name} onChange={function(event) { var value = event.target.value.toUpperCase(); - var nameRegex = /^[-&\\.\\*A-Z0-9]*$/; + var nameRegex = /^[ -&\\.\\*A-Z0-9]*$/; if (value.length <= 8 && nameRegex.test(value)) { this.setState({new_name: value}); }