better url plugin
authorx2000habouzit <x2000habouzit>
Tue, 24 Aug 2004 19:34:21 +0000 (19:34 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 24 Aug 2004 19:34:21 +0000 (19:34 +0000)
plugins/modifier.url.php

index 4ec32d2..a16acdb 100644 (file)
@@ -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 '';
 }
 ?>