From 1501525c902829f0ee538561f3cea1cdd390a21e Mon Sep 17 00:00:00 2001 From: short <> Date: Wed, 26 Sep 2001 22:45:06 +0000 Subject: [PATCH] +dirnameslashed($filename) - PHP dirname() is broken: ("/1/2/3"=>"/1/2", "/1"->"/") ! --- common.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.php b/common.php index 1749106..ab99ea7 100644 --- a/common.php +++ b/common.php @@ -304,6 +304,15 @@ function image_supported($mime) return(false); } +// PHP dirname() is broken: ("/1/2/3"=>"/1/2", "/1"->"/") +function dirnameslashed($filename) +{ + $r=dirname($filename); + if (substr($r,-1)!="/") + $r.="/"; + return($r); +} + function footer($delimit=true) { // deadlock prevention: -- 1.8.3.1