Opened 11 years ago
Closed 11 years ago
#35631 closed defect (bug) (fixed)
Possible PHP notice when updating Site Info
| Reported by: | flixos90 | Owned by: | jeremyfelt |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | Networks and Sites | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch |
| Cc: | Focuses: | multisite |
Description
When updating a site's domain & path in the "Info" tab of Site Info, it can lead to a PHP notice being shown if a path is not included.
While paths are a crucial part to working with subdirectory installs, they are not really used on subdomain installs. In my opinion you should be able to enter http://example.com without appending the trailing slash, and WordPress should handle this automatically. Basically, if there's no trailing slash, assume the path is simply '/', otherwise take what's provided.
The notice is being generated because if you do not provide a path, the path key from parse_url() is not available. This is it:
Notice: Undefined index: path in /Volumes/HDD/user/site/web/core/wp-admin/network/site-info.php on line 83
Attachments (2)
Change History (10)
#2
follow-up:
↓ 3
@
11 years ago
Thanks for the patch @kjbenk. However I'd rather have it detect whether the path is set, and otherwise simply define a path of only a trailing slash. I think showing an error message would confuse the user here.
#3
in reply to: ↑ 2
;
follow-up:
↓ 4
@
11 years ago
Replying to flixos90:
I'd rather have it detect whether the path is set, and otherwise simply define a path of only a trailing slash. I think showing an error message would confuse the user here.
I am not 100% familiar with how the site url affects multisite but would this create any unwanted affects?
#4
in reply to: ↑ 3
@
11 years ago
Replying to kjbenk:
Replying to flixos90:
I'd rather have it detect whether the path is set, and otherwise simply define a path of only a trailing slash. I think showing an error message would confuse the user here.
I am not 100% familiar with how the site url affects multisite but would this create any unwanted affects?
It won't since basically, there should not be any difference in whether you specify a URL with or without trailing slash. However, every site needs to have a path (when using subdomains only, this path is '/') - so if you don't specify a path, we can safely assume it is the '/' I think.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This does not sound like a major issue but here is a patch to check for each part of the URL that is needed. If the URL is not valid it will tell the user.