mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 06:54:00 +00:00
Merge "Block all combinations of refines="…" and follows="…""
This commit is contained in:
commit
62ca80536e
|
@ -426,7 +426,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