Add new required attribute to ensure compatibility

This commit is contained in:
Andy Miller 2018-04-10 15:12:12 -06:00
parent c7b17a8d88
commit b7912dccd8
No known key found for this signature in database
GPG Key ID: E82B8D0EAB94EFB9

View File

@ -59,9 +59,17 @@ trait ParsedownGravTrait
* @param bool $continuable
* @param bool $completable
* @param $index
* @param bool $allow this is mandatory to pass through to be compatible with Parsedow 1.8.0
*/
public function addBlockType($type, $tag, $continuable = false, $completable = false, $index = null)
public function addBlockType($type, $tag, $continuable = false, $completable = false, $index = null, $allow = false)
{
// This mandatory attribute ensures that only updated and compatible plugins
// will be able to add the blocktype attributes, as old plugins that have not been updated
// can break Grav completely until the plugin is disabled
if (!$allow) {
return;
}
$block = &$this->unmarkedBlockTypes;
if ($type) {
if (!isset($this->BlockTypes[$type])) {