From 4ca1225fd0acd7fe6f6e124b91ddb19eca94fb6c Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Tue, 10 Jun 2014 13:56:40 +0200 Subject: [PATCH] Fix saving of modified content. A bug caused text to be saved only if links were added by smart mode algorithm, not by normal algorithm. --- LinkTitles.body.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LinkTitles.body.php b/LinkTitles.body.php index 350132a..4d8a3ac 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -252,7 +252,7 @@ break; }; }; - $text = implode( '', $arr ); + $newText = implode( '', $arr ); // If smart mode is turned on, the extension will perform a second // pass on the page and add links with aliases where the case does @@ -297,7 +297,7 @@ }; } - $arr = preg_split( $delimiter, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); + $arr = preg_split( $delimiter, $newText, -1, PREG_SPLIT_DELIM_CAPTURE ); for ( $i = 0; $i < count( $arr ); $i+=2 ) { // even indexes will point to text that is not enclosed by brackets @@ -309,9 +309,9 @@ }; }; $newText = implode( '', $arr ); - if ( $newText != $text ) { - $content = $content->getContentHandler()->unserializeContent( $newText ); - } + if ( $newText != $text ) { + $content = $content->getContentHandler()->unserializeContent( $newText ); + } } // $wgLinkTitlesSmartMode } }; // foreach $res as $row