Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There exists request_path() in the API docs, don't use $_REQUEST['q'] because on some server configurations it will return false/empty, always use request_path() instead for getting the original request
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/reque...
http://example.com/path/alias (which is a path alias for node/306) returns "path/alias" as opposed to the internal path.
Otherwise you may get some loops occuring because it's not checking the right value
Comment | File | Size | Author |
---|---|---|---|
#1 | 1834366-request-path.patch | 3.02 KB | dgtlmoon |
Comments
Comment #1
dgtlmoon CreditAttribution: dgtlmoon commentedComment #2
jm.federico CreditAttribution: jm.federico commentedThis has been fixed already
Cheers
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedWrong, patch still applies
Comment #4
jm.federico CreditAttribution: jm.federico commented@dgtlmoon
I'm sorry if I ofended you with the way my comment was posted, but I feel telling someone that one is wrong with no further explanation of why one is wrong is a bit rude.
As per the "wrong", I insist, it has been fixed.
I think you are looking at the master branch and nod the 7.x-1.x branch.
Last update to master was 20 months ago, last update to 7.x-1.x was 5 weeks ago.
Indeed, master branch is still using $_REQUEST['q'] in many places, but that branch is not used for any releases.
Cheers
Comment #5
jm.federico CreditAttribution: jm.federico commentedComment #6
dgtlmoon CreditAttribution: dgtlmoon commentedAaah my mistake! all good then, yeah its confusing with these master branches, i've made that mistake myself also, is it possible to empty/delete it? not real clear how that works here
Comment #8
Greg__ CreditAttribution: Greg__ commentedI got an infinite loop because my $_REQUEST['q'] was empty.
The globalredirect_request_path function always return an empty path :
And this cause an infinite loop because of this code in the globalredirect_init function :
So idon't know about your branch but the actual dev and stable module still have the $_REQUEST['q'].
FYI I stopped this loop by changing the testing condition of $_REQUEST['q'] (until a better fix) :
Comment #9
RavindraSingh CreditAttribution: RavindraSingh commentedTested, it is already fixed in 7.x-1.5 release. So closing this issue.