mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2025-08-01 15:54:34 +00:00
add check for proper class hiearchy in table syntax
Plugins extend this class, but may not inherit from Aggregation, yet. A proper error should be shown.
This commit is contained in:
@ -115,8 +115,12 @@ class syntax_plugin_struct_table extends DokuWiki_Syntax_Plugin
|
||||
$search->setOffset(0);
|
||||
}
|
||||
|
||||
/** @var Aggregation $table */
|
||||
$table = new $this->tableclass($mainId, $format, $renderer, $search);
|
||||
if (!is_a($table, Aggregation::class)) {
|
||||
// this may happen with plugins that extend struct
|
||||
throw new StructException('Aggregation class does not inherit Aggregation: ' . $this->tableclass);
|
||||
}
|
||||
|
||||
$table->startScope();
|
||||
$table->render(true);
|
||||
$table->finishScope();
|
||||
|
Reference in New Issue
Block a user