aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-12-02 23:25:45 +0000
committerplegall <plg@piwigo.org>2008-12-02 23:25:45 +0000
commitfa47fc120b55a4dfef98e031f3406eeb2ecd3c47 (patch)
tree292ae7701bea5c447456cb5b9d6f196e80f8370d /include/functions.inc.php
parentb66f527601e7e9e5aac4ac19c6109d808f1ef56e (diff)
bug 904 fixed: an index.htm is created in directories created by
pwg.images.add web API method, only directories that contains pictures. git-svn-id: http://piwigo.org/svn/branches/2.0@2916 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 093f207e9..513054ab9 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1540,4 +1540,18 @@ function convert_charset($str, $source_charset, $dest_charset)
}
return $str; //???
}
+
+/**
+ * makes sure a index.htm protects the directory from browser file listing
+ *
+ * @param string dir directory
+ */
+function secure_directory($dir)
+{
+ $file = $dir.'/index.htm';
+ if (!file_exists($file))
+ {
+ @file_put_contents($file, 'Not allowed!');
+ }
+}
?> \ No newline at end of file