r66634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66633‎ | r66634 | r66635 >
Date:00:03, 19 May 2010
Author:vyznev
Status:ok (Comments)
Tags:
Comment:
bug 23588: properly colon-escape links used to replace transclusions if post-expand include size is too large
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -3130,8 +3130,16 @@
31313131
31323132 if ( is_string( $text ) && !$this->incrementIncludeSize( 'post-expand', strlen( $text ) ) ) {
31333133 # Error, oversize inclusion
3134 - $text = "[[$originalTitle]]" .
3135 - $this->insertStripItem( '<!-- WARNING: template omitted, post-expand include size too large -->' );
 3134+ if ( $titleText !== false ) {
 3135+ # Make a working, properly escaped link if possible (bug 23588)
 3136+ $text = "[[:$titleText]]";
 3137+ } else {
 3138+ # This will probably not be a working link, but at least it may
 3139+ # provide some hint of where the problem is
 3140+ preg_replace( '/^:/', '', $originalTitle );
 3141+ $text = "[[:$originalTitle]]";
 3142+ }
 3143+ $text .= $this->insertStripItem( '<!-- WARNING: template omitted, post-expand include size too large -->' );
31363144 $this->limitationWarn( 'post-expand-template-inclusion' );
31373145 }
31383146

Comments

#Comment by MarkAHershberger (talk | contribs)   16:46, 14 December 2010

Tested, works seams fine.

Status & tagging log