tony2001 Mon Mar 12 23:42:26 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard string.c
Log:
return false instead of empty string when -length is greater than (len -
offset)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.52&r2=1.445.2.14.2.53&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.52
php-src/ext/standard/string.c:1.445.2.14.2.53
--- php-src/ext/standard/string.c:1.445.2.14.2.52 Sat Mar 10 20:07:50 2007
+++ php-src/ext/standard/string.c Mon Mar 12 23:42:26 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.445.2.14.2.52 2007/03/10 20:07:50 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.53 2007/03/12 23:42:26 tony2001 Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -2077,6 +2077,10 @@
RETURN_FALSE;
}
+ if (l < 0 && (l + Z_STRLEN_PP(str) - f) < 0) {
+ RETURN_FALSE;
+ }
+
/* if "from" position is negative, count start position from the end
* of the string
*/
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php