From: x2000habouzit Date: Tue, 24 Aug 2004 19:34:21 +0000 (+0000) Subject: better url plugin X-Git-Tag: xorg/old~1720 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0d2a7d4471dc7ab992fd2dbda2de04d1d9fc41ac;p=platal.git better url plugin --- diff --git a/plugins/modifier.url.php b/plugins/modifier.url.php index 4ec32d2..a16acdb 100644 --- a/plugins/modifier.url.php +++ b/plugins/modifier.url.php @@ -3,11 +3,11 @@ function smarty_modifier_url($string) { if(strpos($string, "http://")!==false) return $string; - $chemins = Array('.', '..', '/'); + $chemins = Array('', '../', '../../'); foreach ($chemins as $ch) { - if (file_exists("$ch/login.php") || file_exists("$ch/public/login.php")) - return "$ch/$string"; + if (file_exists($ch.'../htdocs/')) + return $ch.$string; } - return ""; + return ''; } ?>