Apache mod_rewrite have proven to be unreliable, as it does some decoding and reencoding of the URL paths. Trying to match Apache's encoding/decoding rules with PHPs one as proven difficult, and we are still using the ugly drupal_urlencode() to double encode some characters of the path.
Let's not depend on Apache / PHP for this, and derive paths from the URL ourselves.
This patch:
- adds path-deriving logic to drupal_initialize_variables()
- removes drupal_urlencode()
- implements drupal_path_encode(), that is specialized in encoding the path part of the URL
- implements a throughout test case
Comments
Comment #1
damien tournoud commentedComment #3
pwolanin commentedI think it might be nicer if you do something like:
Also, I think you might want
"The filename of the currently executing script, relative to the document root." , instead of
"Contains the current script's path."
Comment #4
damien tournoud commentedI don't really see the point. It is much simpler to simple derive $_GET['q'] from the requested URI if it is not set.
That was my starting point, until I saw:
The code that I use for that is simply moved from something that was already there in conf_init().
Comment #5
jody lynn#1: 484554-stop-relying-on-apache.patch queued for re-testing.
Comment #7
andypostRelated #1055856-14: Optimize settings.php discovery
Comment #8
sunhttp://www.php.net/manual/en/reserved.variables.server.php states:
---
Is this issue still relevant with these other D8 issues?
#1183208: Remove variable_get('clean_url') and switch to index.php/path pattern for dirty URL support
#1463656: Add a Drupal kernel; leverage HttpFoundation and HttpKernel
Comment #9
valthebaldI second to @sun's question, is this still relevant?
Comment #10
damien tournoud commentedSomething very similar went into Drupal 7 in a separate issue. So no, this is not relevant by a long shot.