Skip to content

Commit a2c7c44

Browse files
committed
unicodeTrim: Combine suffix and prefix matching
1 parent af7522b commit a2c7c44

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Mf2/Parser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ function collapseWhitespace($str) {
113113
function unicodeTrim($str) {
114114
// this is cheating. TODO: find a better way if this causes any problems
115115
$str = str_replace(mb_convert_encoding(' ', 'UTF-8', 'HTML-ENTITIES'), ' ', $str);
116-
$str = preg_replace('/^\s+/', '', $str);
117-
return preg_replace('/\s+$/', '', $str);
116+
return preg_replace('/^\s+|\s+$/', '', $str);
118117
}
119118

120119
/**

0 commit comments

Comments
 (0)