The PHPDoc for request_uri() says:
Because $_SERVER['REQUEST_URI'] is only available on Apache, we generate an equivalent using other environment variables.
This is incorrect as IIS7 sets $_SERVER['REQUEST_URI'], and I'm guessing so do some other modern web servers. We need to research the current state of popular web servers and update this documentation accordingly.
Related: #1547310: request_uri() returns incorrect URI for some builds of IIS7
Comments
Comment #1
effulgentsia CreditAttribution: effulgentsia commentedtagging
Comment #1.0
effulgentsia CreditAttribution: effulgentsia commentedUpdated issue summary.
Comment #2
Robert_T CreditAttribution: Robert_T as a volunteer commentedThis issue appears to be obsolete. The request_uri() function does not appear in D8; the closest equivalent is in \Symfony\Component\HttpFoundation\ApacheRequest::prepareRequestUri().
Comment #3
dawehnerYou are absolutely right, this method is not in Drupal itself anymore. Especially
\Symfony\Component\HttpFoundation\Request::prepareRequestUri
has quite some edge cases shown, so I think its fine to close this issue.Comment #5
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedShould probably do something about that for Drupal 7, though.