Bug #28685

t3lib_div::getIndpEnv('REQUEST_URI') does not return fragment/hash of url

Added by Simon Schaufelberger over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-08-02
Due date:
% Done:

0%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As written in the comment in the function getIndpEnv, this function does not handle the fragment (the text after # in the url) which is not good if you really need that part of a url. Of course there are workarounds but still, this IS a bug and should be fixed.
I for example need this to trigger a jQuery function and for that i need that hash after a redirect with the loginbox

History

#1 Updated by Simon Schaufelberger over 8 years ago

this is the way how it will work:
http://stackoverflow.com/questions/940905/can-php-read-the-hash-portion-of-the-url#answer-940996

http://www.php.net/manual/en/function.parse-url.php

parse_url("http://foo?bar#fizzbuzz",PHP_URL_FRAGMENT);

output:
fizzbuzz

#2 Updated by Simon Schaufelberger over 8 years ago

The Fragment is never sent to the server. So, this might be impossible unless you use AJAX to change the page after the fact.

Another idea would be to have Javascript turn the hash into a $_GET paramater, and then refresh the page.

ok, so this will not work. :(

It is acuatally not a php but a browser bug, see: https://bugs.php.net/bug.php?id=25804

#3 Updated by Oliver Hader over 8 years ago

  • Status changed from New to Closed

So no change required here.

Also available in: Atom PDF