Merge "Block all combinations of refines="…" and follows="…""

This commit is contained in:
jenkins-bot 2019-11-11 12:37:34 +00:00 committed by Gerrit Code Review
commit 62ca80536e
3 changed files with 10 additions and 4 deletions

View file

@ -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 ];
}

View file

@ -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">&#91;1&#93;</a></sup>
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code>&lt;ref&gt;</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">&#91;1&#93;</a></sup>
<sup id="cite_ref-b_2-0" class="reference"><a href="#cite_note-b-2">&#91;2&#93;</a></sup>
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code>&lt;ref&gt;</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>

View file

@ -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