From: Antony Dovgal Date: Sun, 22 Apr 2007 19:22:19 +0000 (+0000) Subject: fix [l]trim() in unicode mode X-Git-Tag: RELEASE_1_2_0~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f9871787e6777914594595fa4bfd9339159e9d8;p=php fix [l]trim() in unicode mode --- diff --git a/ext/standard/string.c b/ext/standard/string.c index e7102d0b03..7f9d15b4e5 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -718,6 +718,9 @@ static UChar *php_u_trim(UChar *c, int len, UChar *what, int what_len, zval *ret if ( what ) { what = eustrndup(what, what_len); php_expand_uchar_range(&what, &what_len TSRMLS_CC); + } else { + what = USTR_MAKE(" \n\r\t\v\0"); + what_len = sizeof(" \n\r\t\v\0") - 1; } if ( mode & 1 ) {