Skip to content
This repository was archived by the owner on Dec 7, 2024. It is now read-only.

Commit 29865ed

Browse files
committed
Exclude hidden directories from importing
1 parent ad055c1 commit 29865ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

includes/PagePort.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ private function getPagesFromDir( $dir ) {
6767
$list = scandir( $dir );
6868
foreach ( $list as $l ) {
6969
if ( !is_dir( $dir . '/' . $l ) ) {
70+
// Skip hidden dirs, like .git
71+
if( strpos( basename( $dir ) . '/' . $l, '.' ) === 0 ) {
72+
continue;
73+
}
7074
$pages[] = [
7175
'name' => basename( $dir ) . ':' . $l,
7276
'content' => file_get_contents( $dir . '/' . $l )

0 commit comments

Comments
 (0)