diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index 691a1d4b4716..6a82df408835 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -889,7 +889,7 @@ public static function snake($value, $delimiter = '_') */ public static function squish($value) { - return preg_replace('~\s+~u', ' ', preg_replace('~^\s+|\s+$~u', '', $value)); + return preg_replace('~(\s|\x{3164})+~u', ' ', preg_replace('~^\s+|\s+$~u', '', $value)); } /** diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index ec93086caba5..26a8b749f456 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -553,6 +553,7 @@ public function testSquish() $this->assertSame('ム', Str::squish('ム')); $this->assertSame('だ', Str::squish('  だ   ')); $this->assertSame('ム', Str::squish('  ム   ')); + $this->assertSame('laravel php framework', Str::squish('laravelㅤㅤㅤphpㅤframework')); } public function testStudly()