[PR #3734] [MERGED] fix: trim whitespace from comma-separated list values in routing rules #5514

Closed
opened 2026-10-31 20:47:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3734
Author: @Alimpo
Created: 2/2/2026
Status: ✅ Merged
Merged: 2/2/2026
Merged by: @MHSanaei

Base: main ← Head: fix-whitespace-from-comma-sepretad-list-fields-in-routing


📝 Commits (1)

  • 1f2ffc4 fix: trim whitespace from comma-separated list values in routing rules

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 web/html/modals/xray_rule_modal.html (+4 -4)

📄 Description

What is the pull request?

This pull request fixes a bug where comma-separated values in routing rule fields were not properly trimmed of whitespace. When users entered values like "user1, user2" in the User field (or other comma-separated fields), the space after the comma was preserved, resulting in ["user1", " user2"] instead of ["user1", "user2"].

The fix adds .map(s => s.trim()) to the getResult() function in the routing rule modal to trim whitespace from each element after splitting comma-separated values. This affects the user, domain, ip, and sourceIP fields.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/3734 **Author:** [@Alimpo](https://github.com/Alimpo) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix-whitespace-from-comma-sepretad-list-fields-in-routing` --- ### 📝 Commits (1) - [`1f2ffc4`](https://github.com/MHSanaei/3x-ui/commit/1f2ffc4969a2a17aef555f5bba69e07c8141a7ab) fix: trim whitespace from comma-separated list values in routing rules ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `web/html/modals/xray_rule_modal.html` (+4 -4) </details> ### 📄 Description ## What is the pull request? This pull request fixes a bug where comma-separated values in routing rule fields were not properly trimmed of whitespace. When users entered values like `"user1, user2"` in the User field (or other comma-separated fields), the space after the comma was preserved, resulting in `["user1", " user2"]` instead of `["user1", "user2"]`. The fix adds `.map(s => s.trim())` to the `getResult()` function in the routing rule modal to trim whitespace from each element after splitting comma-separated values. This affects the `user`, `domain`, `ip`, and `sourceIP` fields. ## Which part of the application is affected by the change? - [x] Frontend - [ ] Backend ## Type of Changes - [x] Bug fix - [ ] New feature - [ ] Refactoring - [ ] Other --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5514
No description provided.