Skip to content

Commit

Permalink
Fix max parser iterations for resources without a template (#16596)
Browse files Browse the repository at this point in the history
### Why is it needed?
Currently for resources without an assigned template ("Uses Template" =
`(empty)` in the manager), the parser is called with a `$depth` (maximum
iterations) of `0`.

---

The second parameter of the `getOption()` function is an array of
`$options` and not the default value:

https://github.com/modxcms/xpdo/blob/ffa5d883ef44bd684db748a3e454071672913e48/src/xPDO/xPDO.php#L705-L711
  • Loading branch information
halftrainedharry authored Aug 2, 2024
1 parent 482c68d commit f28e06e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/Revolution/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public function process()
}
} else {
$this->_content = $this->getContent();
$maxIterations = intval($this->xpdo->getOption('parser_max_iterations', 10));
$maxIterations = intval($this->xpdo->getOption('parser_max_iterations', null, 10));
$this->xpdo->parser->processElementTags('', $this->_content, false, false, '[[', ']]', [],
$maxIterations);
$this->_processed = true;
Expand Down

0 comments on commit f28e06e

Please sign in to comment.