mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-14 10:34:53 +00:00
(bug 11426) Give error if no text is supplied for a reference. Patch by Thomas Dalton. All parser tests passed.
This commit is contained in:
parent
a5114ab0ec
commit
19d69a96f7
|
@ -31,6 +31,7 @@ $wgCiteMessages['en'] = array(
|
||||||
<code><references /></code>',
|
<code><references /></code>',
|
||||||
'cite_error_' . CITE_ERROR_REFERENCES_INVALID_PARAMETERS => 'Invalid <code><references></code> tag; no parameters are allowed, use <code><references /></code>',
|
'cite_error_' . CITE_ERROR_REFERENCES_INVALID_PARAMETERS => 'Invalid <code><references></code> tag; no parameters are allowed, use <code><references /></code>',
|
||||||
'cite_error_' . CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL => "Ran out of custom backlink labels, define more in the \"''cite_references_link_many_format_backlink_labels''\" message",
|
'cite_error_' . CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL => "Ran out of custom backlink labels, define more in the \"''cite_references_link_many_format_backlink_labels''\" message",
|
||||||
|
'cite_error_' . CITE_ERROR_REFERENCES_NO_TEXT => 'No text given.',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Output formatting
|
Output formatting
|
||||||
|
|
10
Cite.php
10
Cite.php
|
@ -44,7 +44,8 @@ $wgCiteErrors = array(
|
||||||
'CITE_ERROR_REF_NO_INPUT',
|
'CITE_ERROR_REF_NO_INPUT',
|
||||||
'CITE_ERROR_REFERENCES_INVALID_INPUT',
|
'CITE_ERROR_REFERENCES_INVALID_INPUT',
|
||||||
'CITE_ERROR_REFERENCES_INVALID_PARAMETERS',
|
'CITE_ERROR_REFERENCES_INVALID_PARAMETERS',
|
||||||
'CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL'
|
'CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL',
|
||||||
|
'CITE_ERROR_REFERENCES_NO_TEXT'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -376,6 +377,13 @@ function wfCite() {
|
||||||
$this->refKey( $key ),
|
$this->refKey( $key ),
|
||||||
$val
|
$val
|
||||||
);
|
);
|
||||||
|
else if ($val['text']=='') return
|
||||||
|
wfMsgForContentNoTrans(
|
||||||
|
'cite_references_link_one',
|
||||||
|
$this->referencesKey( $key ),
|
||||||
|
$this->refKey( $key, $val['count'] ),
|
||||||
|
$this->error(CITE_ERROR_REFERENCES_NO_TEXT)
|
||||||
|
);
|
||||||
// Standalone named reference, I want to format this like an
|
// Standalone named reference, I want to format this like an
|
||||||
// anonymous reference because displaying "1. 1.1 Ref text" is
|
// anonymous reference because displaying "1. 1.1 Ref text" is
|
||||||
// overkill and users frequently use named references when they
|
// overkill and users frequently use named references when they
|
||||||
|
|
Loading…
Reference in a new issue