X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Ffiltres_mini.php;fp=www%2Fecrire%2Finc%2Ffiltres_mini.php;h=55e5ddebc4acf440d26924b525dbba2ac49c40e3;hp=077b239704e2ca27bedbfaf1e7a3418f165be750;hb=e99f0878011913365e49b30d90e496c24c301393;hpb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed diff --git a/www/ecrire/inc/filtres_mini.php b/www/ecrire/inc/filtres_mini.php index 077b239..55e5dde 100644 --- a/www/ecrire/inc/filtres_mini.php +++ b/www/ecrire/inc/filtres_mini.php @@ -3,7 +3,7 @@ /***************************************************************************\ * SPIP, Systeme de publication pour l'internet * * * - * Copyright (c) 2001-2011 * + * Copyright (c) 2001-2014 * * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * * * * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * @@ -23,17 +23,15 @@ if (!defined('_ECRIRE_INC_VERSION')) return; // inspire (de loin) par PEAR:NetURL:resolvePath // // http://doc.spip.org/@resolve_path -function resolve_path($url) { - list($url, $query) = explode('?', $url,2); - while (preg_match(',/\.?/,', $url, $regs) # supprime // et /./ +function resolve_path($url_o) { + preg_match('@^([^?]*)(.*)$@', $url_o, $regs); + list(,$url, $query) = $regs; + while (preg_match(',/\.?/,', $url, $regs) # supprime // et /./ OR preg_match(',/[^/]*/\.\./,S', $url, $regs) # supprime /toto/../ - OR preg_match(',^/\.\./,S', $url, $regs)) # supprime les /../ du haut + OR preg_match(',^/\.\./,S', $url, $regs)) # supprime les /../ du haut $url = str_replace($regs[0], '/', $url); - if ($query) - $url .= '?'.$query; - - return '/'.preg_replace(',^/,S', '', $url); + return '/'.preg_replace(',^/,S', '', $url . $query); } //