Opened 6 years ago
Closed 5 years ago
#44808 closed defect (bug) (fixed)
Creating subsite with un-trimmed space results in "Missing or invalid site address."
Reported by: | aubreypwd | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Networks and Sites | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
When adding a site:
http://aubrey.pw/d/2018/t96dsz13Kd.png
If the Site Address contains a space at the end (which is easily noticeable) it can result in "Missing or invalid site address.":
http://aubrey.pw/d/2018/b9zBWfACwV.png
We can improve this by sanitizing/trimming whitespace from the input.
Attachments (2)
Change History (7)
#2
@
5 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 4.9.8 to 3.1
Good catch, it makes sense to trim this before validation.
@dharmin16 44808.patch looks like a good start, however the trim()
should happen before validation rather than as a part of it. In the current form, the path is still saved with a space (e.g. /path-name /
) in the database. This may mean using another variable to store $blog['domain']
during validation.
#3
@
5 years ago
Hi @jeremyfelt,
As per your advice, I've added changes. I've named the temporary variable as $raw_domain
. If it's confusing, please share your suggestions.
Thanks
Add domain into trim function to trim spaces if added by mistake.