mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
Adding check for illegal attributes in references tag
Bug: T51538 Change-Id: I7dbc577a61abb660d2bdb66ead0d7b71fd66cf47
This commit is contained in:
parent
4310b6a243
commit
01cf61ad67
|
@ -413,6 +413,18 @@ class References extends ExtensionTagHandler {
|
|||
|
||||
if ( !$isTplWrapper ) {
|
||||
$dataMw = DOMDataUtils::getDataMw( $refsNode );
|
||||
|
||||
// Detect invalid parameters on the references tag
|
||||
$knownAttributes = [ 'group', 'responsive' ];
|
||||
foreach ( $dataMw->attrs as $key => $value ) {
|
||||
if ( !in_array( strtolower( $key ), $knownAttributes, true ) ) {
|
||||
self::addErrorsToNode(
|
||||
$refsNode, [ [ 'key' => 'cite_error_references_invalid_parameters' ] ]
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Mark this auto-generated so that we can skip this during
|
||||
// html -> wt and so that clients can strip it if necessary.
|
||||
if ( $autoGenerated ) {
|
||||
|
|
Loading…
Reference in a new issue