[TYPO3-core] RFC: #8205: Shortcut ends in parse_url-error

Steffen Kamper steffen at sk-typo3.de
Mon Jun 16 14:12:29 CEST 2008


"Martin Kutschker" <martin.kutschker-no at spam-blackbox.net> schrieb im 
Newsbeitrag 
news:mailman.1.1213614693.14529.typo3-team-core at lists.netfielders.de...
> You don't get my point. I can do it like this:
>
> function x(arg) {
>   // remove host on ALL parameters
>   ...
>   // do the real stuff
>   ...
> }
> x(parameter)
>
> or like that:
>
> function x(arg) {
>   // do the real stuff
>   ...
> }
> parameter = 'whatever'
> // remove host from paramter ONLY
> ...
> x(parameter)
>
> The difference is that in the second version the calling code does the 
> removal. Your code does that on all arguments which is wrong. If you need 
> it more than once, you can provide a wrapper rawurlencodeURLparams() that 
> does this hostname removal magic.
>
> And you could at least take the hostname (with or without the scheme) from 
> location.host et al.
>
> Masi

Hi Masi,

i understand what you mean. I searched in core where the function is called 
and found 21 places.
All of them does it in same mannar for URL-param in URL.
I don't see any reason for absolute URL in all cases. Ok, it works, but if 
you create a shortcut with any of these URLs, the host info is stored in 
Database which is wrong. So i see no reason at all for the absolute URL, 
IMHO automatic removal for host is ok.
If you have a reason for the absolute URL i would prefer a method like you 
suggested.

vg Steffen 




More information about the TYPO3-team-core mailing list