(bug 8304) Line breaks in "new page" autosummaries should be converted to spaces.
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 22 Dec 2006 19:58:25 +0000 (19:58 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 22 Dec 2006 19:58:25 +0000 (19:58 +0000)
includes/Article.php

index 7332064..ebcb048 100644 (file)
@@ -2771,8 +2771,10 @@ class Article {
                if ($flags & EDIT_NEW && strlen($newtext)) {
                        #If they're making a new article, give its text, truncated, in the summary.
                        global $wgContLang;
-                       $truncatedtext = $wgContLang->truncate( $newtext, max( 0, 200 - 
-                               strlen( wfMsgForContent( 'autosumm-new') ) ), '...' );
+                       $truncatedtext = $wgContLang->truncate(
+                               str_replace("\n", ' ', $newtext),
+                               max( 0, 200 - strlen( wfMsgForContent( 'autosumm-new') ) ),
+                               '...' );
                        $summary = wfMsgForContent( 'autosumm-new', $truncatedtext );
                }