Skip to content

Commit

Permalink
Merge pull request #235 from magicHatOfTYPO3/master
Browse files Browse the repository at this point in the history
[BUGFIX] Respect configured Doktypes while Auto-Tagging
  • Loading branch information
christianbltr authored Jul 19, 2024
2 parents d60f128 + eccdb93 commit 751e908
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Classes/Indexer/Types/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ public function startIndexing()
// excluded (see: http://forge.typo3.org/issues/49435)
$where = ' (doktype = 1 OR doktype = 2 OR doktype = 4 OR doktype = 5 OR doktype = 254) ';

// respect configured doktypes but ensure it's only a commaseparated list of integer values to avoid a SQL injection.
if (!empty($this->indexerConfig['index_page_doctypes'])) {
$indexerConfigDoktypes = GeneralUtility::intExplode(',', $this->indexerConfig['index_page_doctypes'], true);
$dokTypes= implode(',', array_unique(array_merge([1, 2, 4, 5, 254], $indexerConfigDoktypes)));
$where = 'doktype in (' . $dokTypes . ')';
}

// add the tags of each page to the global page array
$this->addTagsToRecords($indexPids, $where);

Expand Down

0 comments on commit 751e908

Please sign in to comment.