diff --git a/src/Sculpin/Bundle/MarkdownBundle/PhpMarkdownExtraParser.php b/src/Sculpin/Bundle/MarkdownBundle/PhpMarkdownExtraParser.php index e8d9632f..7c00f8b5 100644 --- a/src/Sculpin/Bundle/MarkdownBundle/PhpMarkdownExtraParser.php +++ b/src/Sculpin/Bundle/MarkdownBundle/PhpMarkdownExtraParser.php @@ -19,4 +19,19 @@ public function transform($content): string { return parent::transform($content); } + + /** + * Casts $attr to String to ensure safe internal handling of preg_* calls + * + * @inheritDoc + */ + public function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $classes = []) + { + return parent::doExtraAttributes( + $tag_name, + (string)$attr, + $defaultIdValue, + $classes + ); + } }