From 9d0292de5164e7c27f1e843ad56af6eefffe4fa7 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Wed, 19 May 2010 00:03:54 +0000 Subject: [PATCH] bug 23588: properly colon-escape links used to replace transclusions if post-expand include size is too large --- includes/parser/Parser.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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' ); } -- 2.20.1