#10447 closed defect (bug) (fixed)
get_home_path() fails when home url and site url differ in case
Reported by: | Denis-de-Bernardy | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Filesystem API | Keywords: | |
Focuses: | Cc: |
Description
If you set your blog's url and site url to the same thing, albeit with differing caps, get_home_path() returns / instead of ABSPATH.
We should probably sanitize/lowercase the two. I've a user who was reporting the weirdest error related to an open_basedir restriction. No wonder it was returning errors...
Change History (15)
#2
@
15 years ago
Sanitizing to lowercase is not going to work in all cases.
Remember most *nix filesystems are case sensitive, and thus, so are the URL's generated for paths.
Without knowing what that function does, given it generates a filesystem path, mearly ignoring the domain name part of the settings could be a middleground. (As thats the only part that can be considered to be case-insensitive on every platform)
#3
@
15 years ago
Yup, we're on the same wavelength. I think it something like this, in get_home_path(), might do the trick:
$home = parse_url($home); $home = $home['path']; $siteurl = parse_url($siteurl); $siteurl = $siteurl['path'];
#8
@
15 years ago
Is it possible taht exemplary data for the two values is provided so that this can be properly tested?
#11
@
14 years ago
- Owner dd32 deleted
- Status changed from new to assigned
just striping myself as owner off this. (Was automatically added based on the component at one stage)
The likelihood is it's also failing if the two differ by a www, but that's just another issue on top of the issues raised in #9873.