Back out accidentally-committed r102967.

This commit is contained in:
Gabriel Wicke 2011-11-14 11:14:39 +00:00
parent 4a2232bbe2
commit f876382e67
Notes: Gabriel Wicke 2011-11-14 11:14:39 +00:00

View file

@ -706,7 +706,7 @@ class Cite {
'cite_references_link_one', 'cite_references_link_one',
$this->referencesKey( $key ), $this->referencesKey( $key ),
$this->refKey( $key, $val['count'] ), $this->refKey( $key, $val['count'] ),
$this->error( 'cite_error_references_no_text', $key, false ) $this->error( 'cite_error_references_no_text', $key )
); );
} }
@ -717,7 +717,7 @@ class Cite {
# $this->refKey( $val['key'], $val['count'] ), # $this->refKey( $val['key'], $val['count'] ),
$this->refKey( $val['key'] ), $this->refKey( $val['key'] ),
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
); );
// 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
@ -729,7 +729,7 @@ class Cite {
$this->referencesKey( $key . "-" . $val['key'] ), $this->referencesKey( $key . "-" . $val['key'] ),
# $this->refKey( $key, $val['count'] ), # $this->refKey( $key, $val['count'] ),
$this->refKey( $key, $val['key'] . "-" . $val['count'] ), $this->refKey( $key, $val['key'] . "-" . $val['count'] ),
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
); );
// Named references with >1 occurrences // Named references with >1 occurrences
} else { } else {
@ -749,7 +749,7 @@ class Cite {
return wfMsgForContentNoTrans( 'cite_references_link_many', return wfMsgForContentNoTrans( 'cite_references_link_many',
$this->referencesKey( $key . "-" . $val['key'] ), $this->referencesKey( $key . "-" . $val['key'] ),
$list, $list,
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key, false ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
); );
} }
} }
@ -793,7 +793,7 @@ class Cite {
return $this->mBacklinkLabels[$offset]; return $this->mBacklinkLabels[$offset];
} else { } else {
// Feed me! // Feed me!
return $this->error( 'cite_error_references_no_backlink_label', null, false ); return $this->error( 'cite_error_references_no_backlink_label' );
} }
} }
@ -823,7 +823,7 @@ class Cite {
return $this->mLinkLabels[$group][$offset - 1]; return $this->mLinkLabels[$group][$offset - 1];
} else { } else {
// Feed me! // Feed me!
return $this->error( 'cite_error_no_link_label_group', array( $group, $message ), false ); return $this->error( 'cite_error_no_link_label_group', array( $group, $message ) );
} }
} }
@ -1065,14 +1065,11 @@ class Cite {
continue; continue;
} }
$text .= "\n<br />"; $text .= "\n<br />";
# Use separate parser from MessageCache to avoid it missing
# replaceLinkHolders() when run from ParserBeforeTidy.
if ( $group == CITE_DEFAULT_GROUP ) { if ( $group == CITE_DEFAULT_GROUP ) {
$msg = $this->error( 'cite_error_refs_without_references', null, false ); $text .= $this->error( 'cite_error_refs_without_references' );
} else { } else {
$msg = $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ), false ); $text .= $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
} }
$text .= MessageCache::singleton()->parse( $msg, $parser->getTitle(), false )->getText();
} }
return true; return true;
} }
@ -1120,20 +1117,18 @@ class Cite {
* *
* @param string $key Message name for the error * @param string $key Message name for the error
* @param string $param Parameter to pass to the message * @param string $param Parameter to pass to the message
* @param boolean $parse Whether to parse the message * @return string XHTML ready for output
* @return string XHTML or wikitext ready for output
*/ */
function error( $key, $param = null, $parse = true ) { function error( $key, $param = null ) {
# We rely on the fact that PHP is okay with passing unused argu- # We rely on the fact that PHP is okay with passing unused argu-
# ments to functions. If $1 is not used in the message, wfMsg will # ments to functions. If $1 is not used in the message, wfMsg will
# just ignore the extra parameter. # just ignore the extra parameter.
$ret = '<strong class="error">' . return
wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) . $this->parse(
'</strong>'; '<strong class="error">' .
if ( $parse ) { wfMsgNoTrans( 'cite_error', wfMsgNoTrans( $key, $param ) ) .
$ret = $this->parse( $ret ); '</strong>'
} );
return $ret;
} }
/** /**