Friday 07 December 2007 5:10:08 am
Not for the first time further digging brings effects ;) I followed all the path that script takes after redirection declaration, through /index.php and back to the eZHTTPTool, and then it became clear: eZHTTPTool::redirect is to be blame for what goes wrong with the brackets. So I took from it what I felt would be essential (almost everything) and here's my solution: I secure unknown parts of the URL myself: if( $http->hasPostVariable( 'xParam' ) )
{
$myURL .= '/(xparam)/'.eZURI::encodeURL( $http->postVariable( 'xParam' ) );
}
Then, instead of using traditional redirection, I use this: $url = eZHTTPTool::createRedirectUrl( $path, array() );
if ( strlen( $Module->RedirectStatus ) > 0 )
{
header( $_SERVER['SERVER_PROTOCOL'] . " " . $status );
eZHTTPTool::headerVariable( "Status", $status );
}
// I REMOVE THIS LINE!
// $url = eZURI::encodeURL( $url );
eZHTTPTool::headerVariable( 'Location', $url );
echo '<HTML><HEAD>';
echo '<META HTTP-EQUIV="Refresh" Content="0;URL='. htmlspecialchars( $url ) .'">';
echo '<META HTTP-EQUIV="Location" Content="'. htmlspecialchars( $url ) .'">';
echo '</HEAD><BODY></BODY></HTML>';
What do you think? Any other way? <b>By the way, since brackets are used by the system, shouldn't they be left alone by the eZURI::encodeURL? Isn't that a little inconsistency?</b>
--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu
|