merge r2916 from branch 2.0 to trunk

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/trunk@2917 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2008-12-02 23:28:32 +00:00
parent 3ab9008e1c
commit 0ffd66ca94
2 changed files with 20 additions and 0 deletions
+14
View File
@@ -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!');
}
}
?>