[Typo3-dev] bug pi_openAtagHrefInJSwindow

Robert Fink robert.fink at gmx.net
Fri Mar 5 13:26:00 CET 2004


hi!

pi_openAtagHrefInJSwindow will pipe the href-contents trought 
htmlspecialchars and by that destroy urls containing "&", because it 
double-encodes &.

The following will face this problem:

# taken from http://de.php.net/manual/en/function.htmlspecialchars.php

# Given a string, this function first strips out all html special characters, 
then
# encodes the string, safely returning an encoded string without double- 
encoding.

function get_htmlspecialchars( $given, $quote_style = ENT_QUOTES ){
   return htmlspecialchars( html_entity_decode( $given, $quote_style ), 
$quote_style );
}

! html_entity_decode requires php4 >= 4.3.0 !

comments wanted.

robert.





More information about the TYPO3-dev mailing list