Posted by Damien Tournoud on June 7, 2009 at 6:59pm
11 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | base system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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
#1
#2
The last submitted patch failed testing.
#3
I think it might be nicer if you do something like:
+ RewriteRule ^(.*)$ index.php?applied_rewrite_rule=1 [L,QSA]Also, I think you might want
$_SERVER['PHP_SELF']"The filename of the currently executing script, relative to the document root." , instead of
$_SERVER['SCRIPT_NAME']"Contains the current script's path."
#4
I 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().
#5
#1: 484554-stop-relying-on-apache.patch queued for re-testing.
#6
The last submitted patch, 484554-stop-relying-on-apache.patch, failed testing.
#7
Related #1055856-14: Optimize settings.php discovery
#8
http://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