Bonjour,
j'ai passé le ht.access en RewriteEngine off
et passé toutes les balises #REWRITEURL des pages html en simple #URL.
Pour mieux contrôler la mise au point de la navigation.
Je repasserai en urls propres si tout va bien avant la mise en production.
si j'appelle une page avec une langue spécifique, par exemple :
dossier.php?id_dossier=7&lang=3
j'obtiens bien dans la barre d'adresse :
dossier.php?id_dossier=7&lang=3
mais #URL_COURANTE ou #URL_COURANTEPARAM
ainsi que
echo $_SERVER['REQUEST_URI'];
rendent :
"dossier.php?id_dossier=7〈=3"
"&lang" est remplacé intempestivement par "〈"
(Testé seulement dans Firefox).
--------------------------------------------------
La réponse in english (of course):
Ampersands (&'s) in URLs
Another common error occurs when including a URL which contains an ampersand ("&"):
<!-- This is invalid! --> <a href="foo.cgi?chapter=1§ion=2©=3&lang=en">...</a>
This example generates an error for "unknown entity section" because the "&" is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert ©=3 to ©=3, which may cause the link to fail. Since 〈 is the HTML entity for the left-pointing angle bracket, some browsers also convert &lang=en to 〈=en. And one old browser even finds the entity §, converting §ion=2 to §ion=2.
To avoid problems with both validators and browsers, always use & in place of & when writing URLs in HTML:
<a href="foo.cgi?chapter=1§ion=2©=3&lang=en">...</a>
Note that replacing & with & is only done when writing the URL in HTML, where "&" is a special character (along with "<" and ">"). When writing the same URL in a plain text email message or in the location bar of your browser, you would use "&" and not "&". With HTML, the browser translates "&" to "&" so the Web server would only see "&" and not "&" in the query string of the request.
--------------
http://209.85.229.132/search?q=cache:pu … clnk&gl=fr
le lien est celui d'un cache Google, parce que la page à jour, est traduite en français et largement édulcorée.
--------------
Epilogue
La correction fonctionne bien en direct à l'intérieur d'une page, mais il n' y a pas de remède facile que je connaisse, lorsque l'adresse est récupérée par les moyens sus-décrits.
Faut-il écrire un filtre qui remplace "〈" par "&lang" pour afficher l'adresse ?
Patcher le fichier substitution ?
Il aurait peut-être mieux valu ne pas utiliser "lang" pour passer la variable dans l'adresse ?
Attention ne pas confondre "<" (<) et "〈" (〈).
Last edited by Léon (15-11-2009 17:31:48)