I have a javascript function which is broken because the ‘ (‘Côte d’Azur’) is not escaped:
Javascript:searchDay(‘month’, ‘France’, ‘Côte d’Azur’, ‘0’, ‘201208’, ’18’);
The parameters are set as followed:
$jsUrl = new JavascriptUrl(
"searchDay",
array("id", "country", "region", "city" , "month", "startDay" )
);
$jsUrl->setParameter("id", "month");
$jsUrl->setParameter('month', $monthCode);
$jsUrl->setParameter('country', $countryName);
$jsUrl->setParameter('region', $regionName );
How can i fix this?
You could try replacing any
'in the string with\'in order to escape them as follows: