Commit Graph

691 Commits

Author SHA1 Message Date
Stanislav Malyshev
b7cf37c3e1 MF5: Fix chunk_split fix - avoid using floats
MF5: Fix money_format - don't give strfmon more arguments then supplied
MF5: Fix str[c]spn integer overflow
2007-06-06 20:06:43 +00:00
Antony Dovgal
43a99cebe2 fix folding 2007-06-05 13:37:05 +00:00
Ilia Alshanetsky
9cfd000ba3 MFB: Corrected fix for CVE-2007-2872 2007-06-03 18:53:51 +00:00
Ilia Alshanetsky
8cd0541be1 MFB: Fixed an interger overflow inside chunk_split(), identified by
Gerhard Wagner
2007-05-30 00:38:00 +00:00
Rasmus Lerdorf
8b1466fdbe MFB 5_2 2007-05-24 21:31:35 +00:00
Rasmus Lerdorf
5f5563da38 MFB 5_2 2007-05-24 20:56:20 +00:00
Antony Dovgal
483c3034bc fix segfault in strripos() when offset == INT_MAX+1
identified and repoted by Joxean Koret
2007-05-10 22:08:35 +00:00
Antony Dovgal
2f9871787e fix [l]trim() in unicode mode 2007-04-22 19:22:19 +00:00
Antony Dovgal
c9b1ff5080 fix #40915 (addcslashes unexpected behavior with binary input) 2007-03-26 10:23:50 +00:00
Marcus Boerger
20a40063c5 - avoid sprintf 2007-02-24 16:25:58 +00:00
Antony Dovgal
2fd25026ea fix off-by-one accidentally introduced by safe_emalloc() patch 2007-02-10 00:48:17 +00:00
Ilia Alshanetsky
e33869d395 MFB: Use safe_emalloc() rather then emalloc() 2007-01-08 14:25:49 +00:00
Sebastian Bergmann
3717df72ae Bump year. 2007-01-01 09:29:37 +00:00
Andrei Zmievski
6212288bea Unicode support in sscanf() and fscanf(). (Tony, Andrei) 2006-12-26 22:34:05 +00:00
Andrei Zmievski
757fb1e01f Bite the bullet and port the natural comparison algorithm to support
UChar strings. Also, simplify the original code.

# Argggghh, post-incremented iteration sucks. That means you, U16_* stuff.
2006-12-21 21:47:56 +00:00
Antony Dovgal
d0e2e6dfe2 fix potential leak, improve length checks 2006-12-20 23:36:43 +00:00
Antony Dovgal
ddd8d7f3ef do not allocate the return value if it wasn't requested 2006-12-20 23:30:11 +00:00
Andrei Zmievski
e722dce575 - Marcus was too quick. Let's put type before zstr in the macros.
- Also mark get_include_path() and restore_include_path() with U.
2006-12-19 21:38:59 +00:00
Ilia Alshanetsky
e96275d8a7 MFB: Less hackish support for spaces at the start of tags within
strip_tags()
2006-12-18 15:04:36 +00:00
Ilia Alshanetsky
0471dd1d94 MFB: Filter fixes:
Fixed possible double encoding problem with sanitizing filters
	Make use of space-strict strip_tags() function
2006-12-18 04:24:38 +00:00
Andrei Zmievski
c46832a1d5 Make hebrev(c) support only binary strings. 2006-12-12 18:17:56 +00:00
Sara Golemon
982af2061f Use proper zstr for str_getcsv() and add documentation for Andrei's peace of mind 2006-12-06 23:14:15 +00:00
Sara Golemon
fac71c77c1 Add str_getcsv() and fix a couple cases in recent fgetcsv() reimplementation 2006-12-05 04:52:44 +00:00
Stanislav Malyshev
40b496d63f Merge from 5.2:
Improve tolower()-related functions on Windows and VC2005 by caching locale and using
tolower_l function.
2006-12-05 02:55:27 +00:00
Andrei Zmievski
411f6ca0fb Unicode support in var_export(). 2006-12-04 18:55:40 +00:00
Andrei Zmievski
658809278e Mark setlocale() as Unicode-safe. It shouldn't be used in
unicode.semantics=on mode anyway.
2006-11-30 21:46:54 +00:00
Andrei Zmievski
d0b44c9eb5 Mark strtr() as Unicode-safe.
# Right, Derick?
2006-11-30 21:20:56 +00:00
Antony Dovgal
a1f6c395cf fix #39621 (str_replace() is not binary safe on strings with equal length) 2006-11-24 21:57:31 +00:00
Andrei Zmievski
97270f4e75 Use u_memcpy() instead of memcpy(). 2006-11-17 16:45:28 +00:00
Andrei Zmievski
b1d83fec6b Fix memory leaks and segfault. 2006-11-17 16:44:23 +00:00
Derick Rethans
7e56771f94 - Add the strtr implementation for unicode for the case where there are
characters with a code point value >= 256.
2006-11-16 20:33:44 +00:00
Andrei Zmievski
2d40fd328d Allow mixing Unicode/binary string types. 2006-11-10 12:01:50 +00:00
Ilia Alshanetsky
2fa1fb9db3 MFB: Catch empty strings right away. 2006-10-11 14:30:50 +00:00
Antony Dovgal
527cc7bd37 avoid reading str[-1], add warning when invalid format specified
add test
2006-10-11 13:14:08 +00:00
Hannes Magnusson
176b72284c Error message clean up
(patch by Matt W (php_lists -AT- realpain.com))
2006-10-08 13:34:24 +00:00
Andrei Zmievski
0ba9147d9b TODO 2006-10-05 22:44:31 +00:00
Andrei Zmievski
0decd2d4e7 Unicode support for str_replace() and str_ireplace().
# This was not trivial.
2006-10-05 22:40:38 +00:00
Andrei Zmievski
f630127685 - Mark stristr() with U.
- zpp support for ucwords()
2006-10-04 17:38:09 +00:00
Andrei Zmievski
4b3a597d29 Unicode support in substr_compare(). 2006-10-04 17:25:12 +00:00
Antony Dovgal
88e893b50a fix #39032 (strcspn() stops on null character) 2006-10-04 11:12:21 +00:00
Antony Dovgal
8d85069827 return false on invalid mode and don't segfault 2006-10-04 10:52:32 +00:00
Andrei Zmievski
481e9fd525 Unicode support in strripos(). 2006-10-03 18:13:36 +00:00
Ilia Alshanetsky
25ac82bbb6 MFB: optimize zend_hash_init() with known hash table sizes. 2006-10-03 17:45:16 +00:00
Antony Dovgal
7dd21d2b9f fix ZTS build 2006-10-03 13:44:14 +00:00
Andrei Zmievski
0b34032e49 - Fix strrpos() logic (which was broken even in PHP 5).
- Optimizations for a couple of functions.
2006-10-02 19:18:14 +00:00
Andrei Zmievski
e673ae2eb9 Make stripos() work with Unicode strings. 2006-10-02 16:52:22 +00:00
Sara Golemon
7f21f36e45 ZTS fix 2006-10-02 01:11:04 +00:00
Andrei Zmievski
2db5bfbadd Heck, might as well commit this.. 2006-09-29 21:00:07 +00:00
Antony Dovgal
cad50f1dd2 one more try to fix ZTS build 2006-09-23 12:22:07 +00:00
Antony Dovgal
e02e25dca2 fix ZTS build 2006-09-23 12:17:43 +00:00
Andrei Zmievski
ca83e9b7a7 Unicode upgrade for quotemeta(). Yes, I know it's ugly. You try making
it pretty.
2006-09-22 19:35:05 +00:00
Andrei Zmievski
cd58faa031 Bring localeconv(), money_format(), and nl_langinfo() to standards. Add
E_STRICT notices about them being deprecated in Unicode mode.
2006-09-22 18:24:12 +00:00
Andrei Zmievski
50fe3da0af Unicode support in count_chars(). Note that due to the size of the
Unicode character set only mode=1 is supported.
2006-09-22 17:47:09 +00:00
Andrei Zmievski
7ff8b9b090 Bug fixes for substr_replace(). 2006-09-20 20:30:19 +00:00
Dmitry Stogov
128548a5c0 Disabled autoconversion of hash keys (from string to unicode) for PHP arrays 2006-09-19 10:38:31 +00:00
Antony Dovgal
1e284298d7 more z/Z fixes 2006-08-31 14:19:33 +00:00
Antony Dovgal
f53f3b01dd fix ZTS build 2006-08-30 20:24:32 +00:00
Ilia Alshanetsky
922fd02404 Avoid TSRMLS_FETCH 2006-08-30 18:40:26 +00:00
Dmitry Stogov
9ea1f365d9 ZTS fix 2006-08-22 04:54:00 +00:00
Andrei Zmievski
9f8bcf3f51 Unicode support for str_word_count() (using the same semantics as for
binary strings).

# These semantics seem quite broken, by the way, as it counts words
# ending or starting with dashes (-). Since this shouldn't really be
# used to count words in Unicode world anyway, supporting the "broken"
# behavior is okay if it helps people with migration.
2006-08-18 18:01:58 +00:00
Andrei Zmievski
253a82d0cc Simplify php_u_trim(). 2006-08-16 18:07:22 +00:00
Andrei Zmievski
2dcfe8aaf5 Fix some trim() issues. 2006-08-15 20:38:12 +00:00
Andrei Zmievski
bd927905ee Unicode support for strcoll(). 2006-08-14 22:00:46 +00:00
Andrei Zmievski
aa9de18ef5 Unicode support for str_split(). 2006-08-14 21:04:50 +00:00
Andrei Zmievski
01e677b37b Unicode support in chunk_split(). 2006-08-14 20:43:23 +00:00
Edin Kadribasic
56a821ec02 Fixed windows build.
Looking at the macro definition it seems that the second argument
to U_STRING_DECL can only be a string literal, not an indetifier.
2006-08-14 11:59:07 +00:00
Ilia Alshanetsky
fa48ce6810 MFB: Various security fixes 2006-08-10 19:02:32 +00:00
Antony Dovgal
8a159b3efc initialize variable 2006-08-10 09:31:24 +00:00
Antony Dovgal
704dc9be61 fix ZTS build 2006-08-09 20:31:06 +00:00
Andrei Zmievski
8d953e611d Unicode support for str_shuffle(). 2006-08-09 20:19:06 +00:00
Andrei Zmievski
7201041bc0 Upgrade str_rot13() to work with IS_UNICODE type. 2006-08-09 20:03:22 +00:00
Frank M. Kromann
4fef78869b Fix ZTS builds 2006-08-09 18:15:06 +00:00
Andrei Zmievski
533196671f addcslashes() and stripcslashes() should work only on binary strings. 2006-08-09 17:40:21 +00:00
Antony Dovgal
2168051985 initialize vars 2006-08-08 22:01:48 +00:00
Andrei Zmievski
1b18b5a68f Convert nl2br() to suppor IS_UNICODE.
# Hmm, it's a bit ugly..
2006-08-08 21:03:11 +00:00
Antony Dovgal
9cc9f2da3e use memrchr/zend_memrchr instead of strrchr
fix wrong test
2006-08-08 09:48:08 +00:00
Antony Dovgal
8320b9a8f0 fix typo and invalid read 2006-08-08 08:59:51 +00:00
Andrei Zmievski
50cb40f389 Simplify strrchr(). 2006-08-04 23:20:04 +00:00
Andrei Zmievski
ad017699b1 Upgrade pathinfo() to Unicode support. 2006-08-04 21:06:11 +00:00
Andrei Zmievski
9ff2107cc1 Upgrade dirname() to support IS_UNICODE. 2006-08-04 18:09:46 +00:00
Andrei Zmievski
49f1d3a779 Upgraded basename() to work on IS_UNICODE strings as well. 2006-08-03 23:45:27 +00:00
Andrei Zmievski
768a9227ed - Adjusted php_u_strtoupper/php_u_strtolower/php_u_strtotitle API to be
more sane.
- Upgrade strtoupper(), strtolower(), strtotitle() to use params API.
2006-08-03 23:09:29 +00:00
Andrei Zmievski
72adc1b397 Update similar_text() to use params API. 2006-08-03 21:46:16 +00:00
Andrei Zmievski
f6f8792be4 A few fixes noted during analysis. 2006-08-02 21:53:43 +00:00
Andrei Zmievski
09811323a9 bin2hex() should accept only binary strings. 2006-08-02 20:38:39 +00:00
Antony Dovgal
f6de0063dd patch for #37846 (wordwrap() wraps incorrectly)
by Dmitry Kononov <ddk at krasn dot ru>
2006-07-28 12:21:34 +00:00
Michael Wallner
6ad2093794 MFB52: fix bug #37945 pathinfo() cannot handle argument with special
characters like german "Umlaute"
2006-07-17 20:43:07 +00:00
Antony Dovgal
688000ca74 fix access to freed memory in pathinfo()
add test
2006-07-17 06:44:45 +00:00
Pierre Joye
02a92e7eb5 - MFB: PATHINFO_FILENAME constant registration (Sara) 2006-07-16 15:56:00 +00:00
Marcus Boerger
92a47b44b4 - Pathinfo allows to get filename (Toby S, Christian S) 2006-07-16 10:34:32 +00:00
Andrei Zmievski
f717e25ce7 FIXME note 2006-07-13 22:26:50 +00:00
Andrei Zmievski
2fbc36496f - Let the caller output a warning instead of having
zend_get_unified_string_type() do it.
- Mark a few more functions are Unicode compatible.
2006-07-13 21:27:48 +00:00
Antony Dovgal
87d846c2cb initialize variables 2006-07-13 17:55:50 +00:00
Antony Dovgal
9de18e2ca2 don't try to compare strings if haystack is "" or shorter than needle
add test
2006-07-12 12:33:04 +00:00
Antony Dovgal
a6e26b742a fix off-by-one in addslashes() in Unicode mode 2006-06-30 09:35:21 +00:00
Hannes Magnusson
bf0a79d381 Updated protos
Fixed vim folding
2006-06-25 19:19:31 +00:00
Hannes Magnusson
53d262c04d Nuke unused var 2006-06-11 20:33:29 +00:00
Ilia Alshanetsky
6434512a05 MFB: Improved performance of str_replace() when doing 1 char to 1 char or 1
char to many chars replacement by 30-40%.
2006-06-10 15:51:23 +00:00
Johannes Schlüter
40da89d6b9 - Fix str_replace with unicode strings as key 2006-05-28 21:09:58 +00:00
Ilia Alshanetsky
7dd87b5307 MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals
string length).
2006-05-10 13:07:56 +00:00