r17382 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17381‎ | r17382 | r17383 >
Date:14:08, 3 November 2006
Author:werdna
Status:old
Tags:
Comment:
(bug 5885) Stop empty <ref name="something" /> tags from preventing a later tag with the same name from displaying correctly (when re-ordering paragraphs which reference the same <ref> tag. Patch by Phil Boswell.
Modified paths:
  • /trunk/extensions/Cite/Cite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite.php
@@ -289,14 +289,18 @@
290290 $this->mRefs[$key]['count'],
291291 $this->mRefs[$key]['number']
292292 );
293 - } else
 293+ } else {
294294 // We've been here before
 295+ if ( empty($this->mRefs[$key]['text']) and !empty($str)) {
 296+ // If no text found before, use this text
 297+ $this->mRefs[$key]['text'] = $str;
 298+ };
295299 return
296300 $this->linkRef(
297301 $key,
298302 ++$this->mRefs[$key]['count'],
299303 $this->mRefs[$key]['number']
300 - );
 304+ ); }
301305 else
302306 $this->croak( CITE_ERROR_STACK_INVALID_INPUT, serialize( array( $key, $str ) ) );
303307 }