Exclude git directories from path traversal
This commit is contained in:
@ -1810,7 +1810,7 @@ function serendipity_traversePath($basedir, $dir='', $onlyDirs = true, $pattern
|
|||||||
if ($aExcludeDirs === null) {
|
if ($aExcludeDirs === null) {
|
||||||
// add _vti_cnf to exclude possible added servers frontpage extensions
|
// add _vti_cnf to exclude possible added servers frontpage extensions
|
||||||
// add ckeditor/kcfinders .thumb dir to exclude, since no hook
|
// add ckeditor/kcfinders .thumb dir to exclude, since no hook
|
||||||
$aExcludeDirs = array("CVS" => true, ".svn" => true, ".thumbs" => true, "_vti_cnf" => true);
|
$aExcludeDirs = array("CVS" => true, ".svn" => true, ".thumbs" => true, "_vti_cnf" => true, ".git" => true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$odir = serendipity_dirSlash('end', $basedir) . serendipity_dirSlash('end', $dir);
|
$odir = serendipity_dirSlash('end', $basedir) . serendipity_dirSlash('end', $dir);
|
||||||
@ -1828,6 +1828,9 @@ function serendipity_traversePath($basedir, $dir='', $onlyDirs = true, $pattern
|
|||||||
if ($onlyDirs === false || $bIsDir) {
|
if ($onlyDirs === false || $bIsDir) {
|
||||||
if ($bPatternMatch &&
|
if ($bPatternMatch &&
|
||||||
(!$bIsDir || $aExcludeDirs == null || !isset($aExcludeDirs[$file]))) {
|
(!$bIsDir || $aExcludeDirs == null || !isset($aExcludeDirs[$file]))) {
|
||||||
|
if ($file == '.git') {
|
||||||
|
echo $file;
|
||||||
|
}
|
||||||
$files[] = array(
|
$files[] = array(
|
||||||
'name' => $file,
|
'name' => $file,
|
||||||
'depth' => $depth,
|
'depth' => $depth,
|
||||||
|
Reference in New Issue
Block a user