r26045 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26044‎ | r26045 | r26046 >
Date:23:38, 23 September 2007
Author:simetrical
Status:old
Tags:
Comment:
(bug 11426) Give error if no text is supplied for a reference. Patch by Thomas Dalton. All parser tests passed.
Modified paths:
  • /trunk/extensions/Cite/Cite.i18n.php (modified) (history)
  • /trunk/extensions/Cite/Cite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite.i18n.php
@@ -31,6 +31,7 @@
3232 <code>&lt;references /&gt;</code>',
3333 'cite_error_' . CITE_ERROR_REFERENCES_INVALID_PARAMETERS => 'Invalid <code>&lt;references&gt;</code> tag; no parameters are allowed, use <code>&lt;references /&gt;</code>',
3434 '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",
 35+ 'cite_error_' . CITE_ERROR_REFERENCES_NO_TEXT => 'No text given.',
3536
3637 /*
3738 Output formatting
Index: trunk/extensions/Cite/Cite.php
@@ -44,7 +44,8 @@
4545 'CITE_ERROR_REF_NO_INPUT',
4646 'CITE_ERROR_REFERENCES_INVALID_INPUT',
4747 'CITE_ERROR_REFERENCES_INVALID_PARAMETERS',
48 - 'CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL'
 48+ 'CITE_ERROR_REFERENCES_NO_BACKLINK_LABEL',
 49+ 'CITE_ERROR_REFERENCES_NO_TEXT'
4950 )
5051 );
5152
@@ -376,6 +377,13 @@
377378 $this->refKey( $key ),
378379 $val
379380 );
 381+ else if ($val['text']=='') return
 382+ wfMsgForContentNoTrans(
 383+ 'cite_references_link_one',
 384+ $this->referencesKey( $key ),
 385+ $this->refKey( $key, $val['count'] ),
 386+ $this->error(CITE_ERROR_REFERENCES_NO_TEXT)
 387+ );
380388 // Standalone named reference, I want to format this like an
381389 // anonymous reference because displaying "1. 1.1 Ref text" is
382390 // overkill and users frequently use named references when they

Follow-up revisions

RevisionCommit summaryAuthorDate
r26326Correcting r26045, references with no text which are used multiple times shou...tango21:54, 2 October 2007

Status & tagging log