diff --git a/Cite.i18n.php b/Cite.i18n.php index 8889b3e5..34dc857d 100644 --- a/Cite.i18n.php +++ b/Cite.i18n.php @@ -31,6 +31,7 @@ $wgCiteMessages['en'] = array( <references />', 'cite_error_' . CITE_ERROR_REFERENCES_INVALID_PARAMETERS => 'Invalid <references> tag; no parameters are allowed, use <references />', '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 diff --git a/Cite.php b/Cite.php index eb4348ac..cbeb4c60 100644 --- a/Cite.php +++ b/Cite.php @@ -44,7 +44,8 @@ $wgCiteErrors = array( 'CITE_ERROR_REF_NO_INPUT', 'CITE_ERROR_REFERENCES_INVALID_INPUT', '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 ), $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 // anonymous reference because displaying "1. 1.1 Ref text" is // overkill and users frequently use named references when they