Skip to content

Commit 039b05b

Browse files
committed
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.
1 parent 76021e6 commit 039b05b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

syntax/table.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,12 @@ public function render($format, Doku_Renderer $renderer, $config)
115115
$search->setOffset(0);
116116
}
117117

118-
/** @var Aggregation $table */
119118
$table = new $this->tableclass($mainId, $format, $renderer, $search);
119+
if (!is_a($table, Aggregation::class)) {
120+
// this may happen with plugins that extend struct
121+
throw new StructException('Aggregation class does not inherit Aggregation: ' . $this->tableclass);
122+
}
123+
120124
$table->startScope();
121125
$table->render(true);
122126
$table->finishScope();

0 commit comments

Comments
 (0)