Sanitize invalid platform IDs on load and add UI validation #4432
+57
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
:and!which break UMO routing and session matching._) and persist the corrected value so the issue does not recur.Description
_sanitize_platform_idand updateload_platforminastrbot/core/platform/manager.pyto replace:/!with_, callsave_config()when a change is made, and log a warning.isPlatformIdValidand validation checks indashboard/src/components/platform/AddNewPlatform.vueto block saving/updating invalid IDs and displaytm('dialog.invalidPlatformId').dialog.invalidPlatformIdlocalization entries todashboard/src/i18n/locales/en-US/features/platform.jsonanddashboard/src/i18n/locales/zh-CN/features/platform.json.Testing
Codex Task
Summary by Sourcery
在加载平台时清理无效的平台 ID,并在前端强制校验,防止创建或更新包含保留字符的平台 ID。
New Features:
Enhancements:
Original summary in English
Summary by Sourcery
Sanitize invalid platform IDs during platform loading and enforce front-end validation to prevent creation or update of platforms with reserved characters in their IDs.
New Features:
Enhancements: