Skip to content

Commit 41261a8

Browse files
committed
Fix crawler passing dir rather than index.html
Fix an issue where the crawler could pass along a directory path instead of passing the index.html filename for a crawled page.
1 parent 6f437ea commit 41261a8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Unreleased
22

33
- Fix multiline options in admin did not save properly.
4+
- Fix an issue where the crawler could pass along a directory path
5+
instead of passing the index.html filename for a crawled page.
46

57
## 9.9.0 (2026-04-02)
68

src/CrawledFiles.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ public static function getPathsIter(): \Iterator {
137137
$static_site_path,
138138
$row->path
139139
);
140-
if ( file_exists( $cc_path ) ) {
140+
if ( is_dir( $cc_path ) ) {
141+
$index_path = $cc_path . DIRECTORY_SEPARATOR . 'index.html';
142+
if ( file_exists( $index_path ) ) {
143+
$row->filename = $index_path;
144+
}
145+
} elseif ( file_exists( $cc_path ) ) {
141146
$row->filename = $cc_path;
142147
}
143148
}

0 commit comments

Comments
 (0)