? Success

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
2 Oct 2014

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 :-)

avatar PhilETaylor PhilETaylor - open - 2 Oct 2014
avatar jissues-bot jissues-bot - change - 2 Oct 2014
Labels Added: ?
avatar betweenbrain
betweenbrain - comment - 2 Oct 2014

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.

avatar PhilETaylor
PhilETaylor - comment - 2 Oct 2014

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.

avatar betweenbrain
betweenbrain - comment - 2 Oct 2014

This is a fringe case I believe.

Very likely, but seems like it won't hurt anything.

@test
After applying this PR nothing seems to break after a cursory check of the admin.

avatar mbabker
mbabker - comment - 2 Oct 2014

@PhilETaylor Could you update installation/application/defines.php also for the sake of consistency?

avatar PhilETaylor PhilETaylor - change - 2 Oct 2014
The description was changed
avatar PhilETaylor
PhilETaylor - comment - 2 Oct 2014

Done.

avatar sovainfo
sovainfo - comment - 2 Oct 2014

Object to this PR. Consider it the wrong thing to do. Only use / in constants.

avatar PhilETaylor
PhilETaylor - comment - 2 Oct 2014

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...

avatar sovainfo
sovainfo - comment - 2 Oct 2014

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.

avatar mbabker
mbabker - comment - 2 Oct 2014

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.

avatar sovainfo
sovainfo - comment - 2 Oct 2014

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.

avatar brianteeman brianteeman - change - 4 Oct 2014
Category IIS
avatar wilsonge wilsonge - close - 22 Dec 2014
avatar wilsonge wilsonge - change - 22 Dec 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-12-22 16:30:07
avatar wilsonge
wilsonge - comment - 22 Dec 2014

No obvious issues either here. And we should be supporting the platform as widely as possible in my opinion. So merged

Add a Comment

Login with GitHub to post a comment