Opened 8 years ago
Closed 7 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.3 |
| Component: | Networks and Sites | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
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
@
7 years ago
- Keywords needs-patch added
- Milestone Awaiting Review → Future Release
- Version 4.9.8 → 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
@
7 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Add domain into trim function to trim spaces if added by mistake.