mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 06:54:00 +00:00
Block all combinations of refines="…" and follows="…"
Note it doesn't make a difference if this is behind the feature flag or not. It should always be forbidden, and in fact is: Either the follows attribute is unknown, or the combination is forbidden. Bug: T236256 Change-Id: Iebbb2d1d5bab183ab0590b8a7a7f6e79d319b72c
This commit is contained in:
parent
d919615e28
commit
fe385ecc37
|
@ -415,7 +415,9 @@ class Cite {
|
|||
return [ null, null, false, $dir, null ];
|
||||
}
|
||||
|
||||
if ( isset( $argv['name'] ) && isset( $argv['follow'] ) ) {
|
||||
if ( isset( $argv['follow'] ) &&
|
||||
( isset( $argv['name'] ) || isset( $argv[self::REFINES_ATTRIBUTE] ) )
|
||||
) {
|
||||
return [ false, false, false, false, false ];
|
||||
}
|
||||
|
||||
|
|
|
@ -416,9 +416,11 @@ wgCiteBookReferencing=true
|
|||
<references />
|
||||
!! html/php
|
||||
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1">[1]</a></sup>
|
||||
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag;
|
||||
invalid names, e.g. too many</span>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">book 1 huh?</span>
|
||||
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">book 1</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! end
|
||||
|
@ -437,9 +439,11 @@ wgCiteBookReferencing=true
|
|||
!! html/php
|
||||
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1">[1]</a></sup>
|
||||
<sup id="cite_ref-b_2-0" class="reference"><a href="#cite_note-b-2">[2]</a></sup>
|
||||
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag;
|
||||
invalid names, e.g. too many</span>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">book 1 huh?</span>
|
||||
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">book 1</span>
|
||||
</li>
|
||||
<li id="cite_note-b-2"><span class="mw-cite-backlink"><a href="#cite_ref-b_2-0">↑</a></span> <span class="reference-text">book 2</span>
|
||||
</li>
|
||||
|
|
|
@ -43,7 +43,7 @@ class CiteTest extends MediaWikiTestCase {
|
|||
// Pairs
|
||||
[ [ 'follow' => 'f', 'name' => 'n' ], [ false, false, false, false, false ] ],
|
||||
[ [ 'follow' => null, 'name' => null ], [ false, false, false, false, false ] ],
|
||||
[ [ 'follow' => 'f', 'refines' => 'r' ], [ null, null, 'f', null, 'r' ] ],
|
||||
[ [ 'follow' => 'f', 'refines' => 'r' ], [ false, false, false, false, false ] ],
|
||||
[ [ 'group' => 'g', 'name' => 'n' ], [ 'n', 'g', null, null, null ] ],
|
||||
|
||||
// Combinations of 3 or more attributes
|
||||
|
|
Loading…
Reference in a new issue