Browse Source

Transformer les caracteres utf8 d'une URL (farsi par ex) selon la RFC 1738

spip-3-stable
Fil 14 years ago
parent
commit
664db9984a
  1. 2
      ecrire/balise/url_.php
  2. 8
      ecrire/inc/utils.php

2
ecrire/balise/url_.php

@ -58,7 +58,7 @@ function generer_generer_url_arg($type, $p, $_id)
}
else
$s = ", '', '', true";
return "generer_url_entite($_id, '$type'$s)";
return "urlencode_1738(generer_url_entite($_id, '$type'$s))";
}

8
ecrire/inc/utils.php

@ -804,6 +804,14 @@ function generer_url_entite($id='', $entite='', $args='', $ancre='', $public=NUL
return '';
}
// Transformer les caracteres utf8 d'une URL (farsi par ex) selon la RFC 1738
function urlencode_1738($url) {
return str_replace(
array('%2F','%3D','%3F','%26'),
array('/' ,'=' ,'?' ,'&'),
rawurlencode($url));
}
// http://doc.spip.org/@generer_url_entite_absolue
function generer_url_entite_absolue($id='', $entite='', $args='', $ancre='', $connect=NULL)
{

Loading…
Cancel
Save