From: Ilmari Karonen Date: Wed, 19 May 2010 00:03:54 +0000 (+0000) Subject: bug 23588: properly colon-escape links used to replace transclusions if post-expand... X-Git-Tag: 1.31.0-rc.0~36795 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=9d0292de5164e7c27f1e843ad56af6eefffe4fa7;p=lhc%2Fweb%2Fwiklou.git bug 23588: properly colon-escape links used to replace transclusions if post-expand include size is too large --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 16be4b1824..bbd529c040 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3130,8 +3130,16 @@ class Parser { if ( is_string( $text ) && !$this->incrementIncludeSize( 'post-expand', strlen( $text ) ) ) { # Error, oversize inclusion - $text = "[[$originalTitle]]" . - $this->insertStripItem( '' ); + if ( $titleText !== false ) { + # Make a working, properly escaped link if possible (bug 23588) + $text = "[[:$titleText]]"; + } else { + # This will probably not be a working link, but at least it may + # provide some hint of where the problem is + preg_replace( '/^:/', '', $originalTitle ); + $text = "[[:$originalTitle]]"; + } + $text .= $this->insertStripItem( '' ); $this->limitationWarn( 'post-expand-template-inclusion' ); }