From: short <> Date: Wed, 26 Sep 2001 22:45:06 +0000 (+0000) Subject: +dirnameslashed($filename) X-Git-Url: http://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=commitdiff_plain;h=1501525c902829f0ee538561f3cea1cdd390a21e +dirnameslashed($filename) - PHP dirname() is broken: ("/1/2/3"=>"/1/2", "/1"->"/") ! --- 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: