Skip to content

Commit

Permalink
Override PhpMarkdownExtraParser's doExtraAttributes method to cast at…
Browse files Browse the repository at this point in the history
…tr to string
  • Loading branch information
beryllium committed Oct 31, 2022
1 parent d04faae commit 5f705d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Sculpin/Bundle/MarkdownBundle/PhpMarkdownExtraParser.php
Expand Up @@ -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
);
}
}

0 comments on commit 5f705d8

Please sign in to comment.