When generating a URL for forwarding, the query string is being converted from
?this=value&that=othervalue
to
?this=value& amp;that=othervalue
(the editor is modifying the encoded text).
$return_url = $modx->makeUrl($modx->getOption('resource'), '', array('this' => 'value', 'that' => 'othervalue'), 'full');
What is the best way to handle this in processing the second key/value set in the resulting $_GET?
if(!empty($_GET['othervalue'])) {
$var = $_GET['othervalue'];
} elseif(!empty($_GET['amp;othervalue'])) {
$var = $_GET['amp;othervalue'];
}
I have seen something like this
// Fix for & bug in url
if( $_GET ) foreach( $_GET as $key => $value )
{
if( strpos( $key, 'amp;' ) === 0 )
{
$new_key = str_replace( 'amp;', '', $key );
$_GET[ $new_key ] = $value;
unset( $_GET[ $key ] );
}
}