User tests: Successful: Unsuccessful:
As requested by @mbabker at https://twitter.com/mbabker/status/517655539439116288
This pull request fixes some IIS compatibility issues where, under some circumstances, when browsing to the example.com/administrator/index.php the following defines are created:
JPATH_BASE = /path/to/site\administrator
JPATH_ADMINISTRATOR = /path/to/site/administrator
Note the wrong \ in the JPATH_BASE
In /libraries/joomla/uri/uri.php we compare JPATH_BASE and JPATH_ADMINISTRATOR with == to see if we should prefix the uri with /administrator or not, and as they are not the same, no /administrator prefix is applied to urls.
The symptom of this will then be, all the urls generated for the Joomla Admin Login page will have a relative URL starting at / and not /administrator which can be easily seen as the Joomla logo doesn't load, and when attempting to login, the form posts to /index.php and not /administrator/index.php and then gives a 404/500 error depending on config.
This PR is fully backward compatible
Head Nod to @redevo for giving me crazy server configs to work with :-)
Labels |
Added:
?
|
This would effect the whole admin console.
As long as your admin console and and your frontend still works then thats the test complete :-)
The PR is replacing / with DIRECTORY_SEPARATOR only - so nothing much has changed as Joomla is already handling all other \ correctly.
This is a fringe case I believe. I've only ever seen this three times before, all on IIS, the other two customers moved to Linux, but this one cant.
@PhilETaylor Could you update installation/application/defines.php
also for the sake of consistency?
Done.
Object to this PR. Consider it the wrong thing to do. Only use / in constants.
Never thought anyone would object to using standard PHP constants for the exact purpose they were designed, to provide maximum compatibility with IIS servers.... oh well...
Consider it bad practise to introduce multiple formats. It means you can't rely of folders seperated by / or . It doesn't matter which separator you use only that you use one. Considering that PHP resolves the platform issue for you by standardizing on / and converting to platform, think Joomla should do the same.
Apparently that isn't happening in all PHP deployments as demonstrated by the discussion linked in the OP and this PR being open. There's also at least one PR I'm aware of where / versus \ is an issue that isn't being handled correctly.
Don't dispute that, only wrong solution chosen. JPATH_BASE should use /. Windows paths should be translated to using / instead of \. Then the information can be used in PHP for comparing and other manipulation. Ofcourse it not needed for filesystem functions. Any other function should not have to deal with it.
Category | ⇒ | IIS |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-22 16:30:07 |
No obvious issues either here. And we should be supporting the platform as widely as possible in my opinion. So merged
Thanks Phil. Can you provide some testing instructions, I'd assume for IIS and non-IIS servers? Does this only affect the admin login? I'd think it potentially affects all of the admin.