jenkins-bot has submitted this change and it was merged.

Change subject: Fix: Edit summaries have a double space
......................................................................


Fix: Edit summaries have a double space

Bug: 52024
Change-Id: Ife7c8f9cf05010c2d0e1d670ca86589431c46fbe
---
M repo/includes/Summary.php
M repo/tests/phpunit/includes/AutocommentTest.php
M repo/tests/phpunit/includes/SummaryTest.php
3 files changed, 20 insertions(+), 20 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/Summary.php b/repo/includes/Summary.php
index 3e007fd..7ff83e1 100644
--- a/repo/includes/Summary.php
+++ b/repo/includes/Summary.php
@@ -413,7 +413,7 @@
                        $mergedString .=  "/* $comment */";
                }
                if ( $summary !== "" ) {
-                       $mergedString .= ($mergedString === "" ? "" : " ") . 
$wgContLang->truncate( $summary, $length - strlen( $mergedString ) );
+                       $mergedString .= $wgContLang->truncate( $summary, 
$length - strlen( $mergedString ) );
                }
 
                // leftover entities should be removed, but its not clear how 
this shall be done
diff --git a/repo/tests/phpunit/includes/AutocommentTest.php 
b/repo/tests/phpunit/includes/AutocommentTest.php
index 6aa9256..d6a3104 100644
--- a/repo/tests/phpunit/includes/AutocommentTest.php
+++ b/repo/tests/phpunit/includes/AutocommentTest.php
@@ -230,13 +230,13 @@
                $lang = \Language::factory( 'en' );
                return array(
                        array( '', '', $lang, '' ),
-                       array( 'foobar', 'This is a test…', $lang, '/* foobar 
*/ This is a test…' ),
-                       array( 'foobar:one', 'This is a test…', $lang, '/* 
foobar:one */ This is a test…' ),
-                       array( 'foobar:one|two', 'This is a test…', $lang, '/* 
foobar:one|two */ This is a test…' ),
-                       array( 'foobar:one|two|three', 'This is a test…', 
$lang, '/* foobar:one|two|three */ This is a test…' ),
-                       array( 'foobar:one|two|three|…', 'This is a test…', 
$lang, '/* foobar:one|two|three|… */ This is a test…' ),
-                       array( 'foobar:one|two|three|<>', 'This is a test…', 
$lang, '/* foobar:one|two|three|<> */ This is a test…' ),
-                       array( 'foobar:one|two|three|&lt;&gt;', 'This is a 
test…', $lang, '/* foobar:one|two|three|&lt;&gt; */ This is a test…' ),
+                       array( 'foobar', 'This is a test…', $lang, '/* foobar 
*/This is a test…' ),
+                       array( 'foobar:one', 'This is a test…', $lang, '/* 
foobar:one */This is a test…' ),
+                       array( 'foobar:one|two', 'This is a test…', $lang, '/* 
foobar:one|two */This is a test…' ),
+                       array( 'foobar:one|two|three', 'This is a test…', 
$lang, '/* foobar:one|two|three */This is a test…' ),
+                       array( 'foobar:one|two|three|…', 'This is a test…', 
$lang, '/* foobar:one|two|three|… */This is a test…' ),
+                       array( 'foobar:one|two|three|<>', 'This is a test…', 
$lang, '/* foobar:one|two|three|<> */This is a test…' ),
+                       array( 'foobar:one|two|three|&lt;&gt;', 'This is a 
test…', $lang, '/* foobar:one|two|three|&lt;&gt; */This is a test…' ),
                        array(  '', str_repeat( 'a', 2*SUMMARY_MAX_LENGTH ), 
$lang, str_repeat( 'a', SUMMARY_MAX_LENGTH-3 ) . '...' ),
                );
        }
diff --git a/repo/tests/phpunit/includes/SummaryTest.php 
b/repo/tests/phpunit/includes/SummaryTest.php
index bbd5b36..547f3c0 100644
--- a/repo/tests/phpunit/includes/SummaryTest.php
+++ b/repo/tests/phpunit/includes/SummaryTest.php
@@ -68,13 +68,13 @@
        public static function providerFormatTotalSummary() {
                return array(
                        array( '', '', '' ),
-                       array( 'foobar', 'This is a test…', '/* foobar */ This 
is a test…' ),
-                       array( 'foobar:one', 'This is a test…', '/* foobar:one 
*/ This is a test…' ),
-                       array( 'foobar:one|two', 'This is a test…', '/* 
foobar:one|two */ This is a test…' ),
-                       array( 'foobar:one|two|three', 'This is a test…', '/* 
foobar:one|two|three */ This is a test…' ),
-                       array( 'foobar:one|two|three|…', 'This is a test…', '/* 
foobar:one|two|three|… */ This is a test…' ),
-                       array( 'foobar:one|two|three|<>', 'This is a test…', 
'/* foobar:one|two|three|<> */ This is a test…' ),
-                       array( 'foobar:one|two|three|&lt;&gt;', 'This is a 
test…', '/* foobar:one|two|three|&lt;&gt; */ This is a test…' ),
+                       array( 'foobar', 'This is a test…', '/* foobar */This 
is a test…' ),
+                       array( 'foobar:one', 'This is a test…', '/* foobar:one 
*/This is a test…' ),
+                       array( 'foobar:one|two', 'This is a test…', '/* 
foobar:one|two */This is a test…' ),
+                       array( 'foobar:one|two|three', 'This is a test…', '/* 
foobar:one|two|three */This is a test…' ),
+                       array( 'foobar:one|two|three|…', 'This is a test…', '/* 
foobar:one|two|three|… */This is a test…' ),
+                       array( 'foobar:one|two|three|<>', 'This is a test…', 
'/* foobar:one|two|three|<> */This is a test…' ),
+                       array( 'foobar:one|two|three|&lt;&gt;', 'This is a 
test…', '/* foobar:one|two|three|&lt;&gt; */This is a test…' ),
                        array(  '', str_repeat( 'a', 2*SUMMARY_MAX_LENGTH ), 
str_repeat( 'a', SUMMARY_MAX_LENGTH-3 ) . '...' ),
                );
        }
@@ -104,7 +104,7 @@
                $summary->addAutoSummaryArgs( array( "four", "five" ) );
 
                $this->assertEquals( 'one, two, three, four, five', 
$summary->getAutoSummary() );
-               $this->assertEquals( "/* summarytest:5| */ one, two, three, 
four, five", $summary->toString() );
+               $this->assertEquals( "/* summarytest:5| */one, two, three, 
four, five", $summary->toString() );
        }
 
        public function testSetAction() {
@@ -192,7 +192,7 @@
                                array( 'x', 'y' ),
                                array( 'A', 'B'),
                                null,
-                               '/* summarytest-testing:2|nl|x|y */ A, B'
+                               '/* summarytest-testing:2|nl|x|y */A, B'
                        ),
                        array( // #4
                                'summarytest',
@@ -201,7 +201,7 @@
                                null,
                                array( 'A', 'B' ),
                                null,
-                               '/* summarytest:2| */ A, B'
+                               '/* summarytest:2| */A, B'
                        ),
                        array( // #5
                                'summarytest',
@@ -210,7 +210,7 @@
                                array( 'x', 'y' ),
                                array( 'A', 'B'),
                                'can I haz world domination?',
-                               '/* summarytest-testing:2|nl|x|y */ can I haz 
world domination?'
+                               '/* summarytest-testing:2|nl|x|y */can I haz 
world domination?'
                                ),
                        array( // #6
                                'summarytest',
@@ -219,7 +219,7 @@
                                null,
                                null,
                                'can I haz world domination?',
-                               '/* summarytest:0| */ can I haz world 
domination?'
+                               '/* summarytest:0| */can I haz world 
domination?'
                                ),
                );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/75869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife7c8f9cf05010c2d0e1d670ca86589431c46fbe
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to