iliaa Wed Apr 1 14:00:39 2009 UTC Modified files: (Branch: PHP_5_3) /php-src NEWS /php-src/ext/standard string.c Log: Fixed bug #47856 (stristr() converts needle to lower-case). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.547&r2=1.2027.2.547.2.965.2.548&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.547 php-src/NEWS:1.2027.2.547.2.965.2.548 --- php-src/NEWS:1.2027.2.547.2.965.2.547 Tue Mar 31 14:26:19 2009 +++ php-src/NEWS Wed Apr 1 14:00:35 2009 @@ -4,6 +4,7 @@ - Undeprecated ticks. (Arnaud) - Upgraded bundled sqlite to version 3.6.12. (Scott) +- Fixed bug #47856 (stristr() converts needle to lower-case). (Ilia) - Fixed bug #47819 (Getting pdo_mysql.so: undefined symbol: mysqlnd_debug_init at startup). (Johannes) - Fixed bug #47816 (pcntl tests failing on NetBSD). (Matteo) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.44&r2=1.445.2.14.2.69.2.45&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.44 php-src/ext/standard/string.c:1.445.2.14.2.69.2.45 --- php-src/ext/standard/string.c:1.445.2.14.2.69.2.44 Tue Mar 17 00:02:39 2009 +++ php-src/ext/standard/string.c Wed Apr 1 14:00:38 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.445.2.14.2.69.2.44 2009/03/17 00:02:39 mattwil Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.69.2.45 2009/04/01 14:00:38 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1595,13 +1595,15 @@ haystack_orig = estrndup(Z_STRVAL_PP(haystack), Z_STRLEN_PP(haystack)); if (Z_TYPE_PP(needle) == IS_STRING) { + char *orig_needle; if (!Z_STRLEN_PP(needle)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter"); efree(haystack_orig); RETURN_FALSE; } - - found = php_stristr(Z_STRVAL_PP(haystack), Z_STRVAL_PP(needle), Z_STRLEN_PP(haystack), Z_STRLEN_PP(needle)); + orig_needle = estrndup(Z_STRVAL_PP(needle), Z_STRLEN_PP(needle)); + found = php_stristr(Z_STRVAL_PP(haystack), orig_needle, Z_STRLEN_PP(haystack), Z_STRLEN_PP(needle)); + efree(orig_needle); } else { SEPARATE_ZVAL(needle); convert_to_long(*needle);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php