concrete5/concrete5 — pull request #1427 by ahukkanen (2013-10-15 12:12:03+00:00)
Title: Honor the URL_REWRITING_ALL setting in the JavaScripts.

On some hosting environments calling some of the dashboard URLs with the /index.php/dashboard/url/slug/ addresses causes a "input not specified error" on the server that cannot be fixed through .htaccess hacks without php.ini changes (which is not possible on all closed environments)

This (probably) happens because on these environments the php.ini setting "cgi.fix_pathinfo" is disabled and cannot be enabled by the user.

A proposed fix to this is to honor the "URL_REWRITING_ALL" setting in the JavaScripts as well. So I added a new global JS variable that does not include the "index.php" in it if the URL_REWRITING_ALL is enabled.

This new JS variable (CCM_BASE_PATH) replaces all instances of CCM_DISPATCHER_FILENAME where the next character to the variable IS NOT "?". And this is because those requests will work normally which don't have the URL slug after "index.php", i.e. there is no problem with calling e.g. "/dir_rel/index.php?cID=123".

Why the CCM_DISPATCHER_FILENAME cannot be replaced then to honor the url rewriting setting?
a) Because this might cause some unexpected behavior. E.g. currently the content block controller expects certain links to have the "index.php" in them.
b) Because then the variable name would be somewhat misleading ("dispatcher filename" would not contain the dispatcher filename)