Commit Graph

512 Commits

Author SHA1 Message Date
Ilia Alshanetsky
d74f9ff550 Improved performance of the implode() function on associated arrays by
200-300%.
2006-06-11 21:55:49 +00:00
Ilia Alshanetsky
37d88ca5a0 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:29:06 +00:00
Ilia Alshanetsky
91bd50d1b0 Fixed bug #37394 (substr_compare() returns an error when offset equals
string length).
2006-05-10 13:07:15 +00:00
Antony Dovgal
896a5216d7 fix possible substr_compare() crash
add new tests
2006-04-25 12:48:42 +00:00
Antony Dovgal
bace0def1e fix spelling in error messages:
greater/less thEn -> greater/less thAn
2006-04-03 09:14:33 +00:00
Antony Dovgal
ef3d879315 MFH: add brackets and clarity 2006-03-14 15:15:22 +00:00
Ilia Alshanetsky
0a076b11df Fixed offset/length parameter validation in substr_compare() function. 2006-03-14 14:55:13 +00:00
Ilia Alshanetsky
80ea07d30c Added overflow checks to wordwrap() function. 2006-03-13 14:37:10 +00:00
Marcus Boerger
5a69b29082 - Warning fixes by Steph 2006-02-26 10:57:00 +00:00
foobar
f80f58168c nuke ws pollution 2006-01-29 17:54:45 +00:00
Pierre Joye
2bfe34e06d - MFH: #36185 str_rot13(NULL) crash 2006-01-28 00:14:01 +00:00
Antony Dovgal
6fcc365c75 MFH: fix typo 2006-01-05 20:49:37 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Antony Dovgal
1b7e3fe2a5 MFH: fix spelling and #35665 2005-12-14 00:54:29 +00:00
foobar
d0a54af4c5 MFH: Nuke php3 legacy 2005-12-05 22:54:01 +00:00
Ilia Alshanetsky
0242b892d2 Fixed bug #35427 (str_word_count() handles '-' incorrectly). 2005-11-29 16:14:19 +00:00
Ilia Alshanetsky
1a04335ec2 MFH: Fixed possible GLOBALS variable override when register_globals are ON.
MFH: Fixed possible register_globals toggle via parse_str().
MFH: Fixed negative offset handling in substr_compare() function.
2005-09-28 22:39:52 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Ilia Alshanetsky
29bf2d3a09 Fixed bug in str_word_count() when charlist if specified and "word" starts
with a character found inside the charlist.
2005-07-23 19:44:13 +00:00
Anantha Kesari H Y
384a96faf6 ext/standard/file.h NetWare LibC has fnmatch and realpath implemented.
ext/standard/syslog.c Except LOG_SYSLOG other syslog macros are supported by NetWare LibC.
ext/standard/string.c NetWare fix for dirname
-- Kamesh
2005-07-15 12:35:12 +00:00
Antony Dovgal
3baf1f7632 fix #33605 (substr_compare() crashes with negative offset & length) 2005-07-07 15:19:40 +00:00
Ilia Alshanetsky
b9575ead72 make substr_count() 30% when counting instances of 1 byte long strings. 2005-06-19 16:31:51 +00:00
Ilia Alshanetsky
67ea97dfdf Added offset & length parameters to substr_count() function. 2005-06-18 18:23:12 +00:00
Derick Rethans
ad21bb1baa - That should have been removed, not commented out. 2005-06-02 08:51:20 +00:00
Derick Rethans
90f4590d87 - Fixed memory corruption in stristr(). 2005-06-02 08:29:37 +00:00
foobar
156a908997 - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier misbehave) 2005-05-31 12:54:56 +00:00
Antony Dovgal
4ce95ef1ea fix bug #33076 (str_ireplace() incorrectly counts result string length and may cause segfault)
add test
2005-05-20 14:23:42 +00:00
Ilia Alshanetsky
ca10457a58 Fixed bug #32530 (chunk_split() does not append endstr if chunklen is
longer then the original string).
2005-04-03 18:08:40 +00:00
Ilia Alshanetsky
f56e5c045c A more performance friendly version of Andrey's patch. 2005-03-12 17:51:19 +00:00
Andrey Hristov
f15c24d44c added an optional third parameter to str_word_count(), which is used as
a list of characters which are considerd "is_alpha()". Thus V14GR4 can
be extracted as one word if the user supplies "14" as charlist.
FR #31560
# Nuno, are you wishing to document this one too? :)
2005-03-12 14:41:20 +00:00
Andrey Hristov
1236cfa38a - type is either 1 or 2 if second parameter is set. if not set then type
is 0.
- use the lvalue for the second rvalue
2005-03-12 13:08:19 +00:00
Marcus Boerger
df56c39bda - Cosmetics 2005-03-10 23:52:43 +00:00
Marcus Boerger
4172ec995c - Do not touch return_valu's refcount or is_ref 2005-03-10 23:42:15 +00:00
Anantha Kesari H Y
033a45903c NetWare allows directory seperator as \ and / 2005-03-01 14:59:37 +00:00
Ilia Alshanetsky
1e6454a67b Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). 2005-01-18 15:47:57 +00:00
Antony Dovgal
39b25e4f3d fix yet another typo 2004-11-21 13:35:32 +00:00
Antony Dovgal
d9dd604ae7 fix typo (bug #30857) 2004-11-21 13:33:20 +00:00
Derick Rethans
59651c4e58 - Fixed bug #30630: Added a BSD based strtod function that is
locale-independent. (PHP part)
2004-11-03 23:36:51 +00:00
Ilia Alshanetsky
0818faee7f Slight optimization in str_split() when split length is the same or greater
then the string length.
2004-10-20 22:44:43 +00:00
Ilia Alshanetsky
2476198086 Fixed bug #30356 (str_ireplace() does not work on all strings). 2004-10-07 23:10:35 +00:00
Andi Gutmans
56f8195fe5 - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
  STR_FREE() and zval_dtor() always have to check for it and it slows down
  the general case. In addition, it seems that empty_string has been abused
  quite a lot, and was used not only for setting zval's but generally in
  PHP code instead of "", which wasn't the intention. Last but not least,
  nuking empty_string should improve stability as I doubt every place
  correctly checked if they are not mistakenly erealloc()'ing it or
  calling efree() on it.
  NOTE: Some code is probably broken. Each extension maintainer should
  check and see that my changes are OK. Also, I haven't had time to touch
  PECL yet. Will try and do it tomorrow.
2004-07-19 07:19:50 +00:00
Andrey Hristov
96f5c697dd Add support for negative values of limit of explode(). If limit is negative
then all components are returned except the last abs(limit) ones.
2004-07-18 11:34:28 +00:00
Andrey Hristov
0eef82a733 fixing bug #28974 : overflow in array_slice()
The same kind of overflow appeared in array_splice(), substr() and
substr_replace()
2004-07-11 21:15:04 +00:00
Ilia Alshanetsky
5201e62d0d Fixed bug #29034 (wordwrap() returns a boolean when passed empty string). 2004-07-06 22:16:42 +00:00
Stefan Esser
a27d5d842a IE we love you all... 2004-06-26 07:43:02 +00:00
Stefan Esser
585628ba67 Fixed: made 3rd parameter to strrpos 64bit safe. 2004-06-15 22:38:18 +00:00
Ilia Alshanetsky
d24465ba8a Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). 2004-05-13 17:44:23 +00:00
Jay Smith
8f306fd749 Fixed a segfault. (It's possible for large offsets to make strrpos()
read past the end of the haystack string...)
2004-05-06 16:11:50 +00:00
Sara Golemon
c52cc1c333 BugFix 27675 and add regression test. 2004-03-26 19:23:42 +00:00
Dmitry Stogov
6e63ea45c7 BUG #27457 was fixed (using temporary hash table with string keys only) 2004-03-18 09:48:37 +00:00
Ard Biesheuvel
81f05c18f5 Wordsize fixes 2004-02-25 20:16:27 +00:00
Sara Golemon
ba8ad292d9 Make today's changes work w/ str_ireplace() as well. 2004-02-23 20:34:59 +00:00
Sara Golemon
1c82797664 Short circuit str_replaces when we already know that needle does not occur in haystack.
Note: Prior bugfix was for #27176 not #27276
2004-02-23 20:13:14 +00:00
Sara Golemon
5144a1f522 Bugfix #27276: When using str_replace to expand a string, count occurances of needle in haystack to avoid massive overallocation 2004-02-23 20:06:01 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Ilia Alshanetsky
56f046a67a Fixed ZTS build. 2003-12-10 21:23:35 +00:00
Moriyoshi Koizumi
b2cd08f33d Fix bug #26574 (basename() doesn't work properly with multibyte characters) 2003-12-10 07:15:28 +00:00
Moriyoshi Koizumi
c4c586a652 Fix typo. 2003-12-10 06:04:15 +00:00
Sara Golemon
feee37a17a Optimize strrpos/strripos for single char strings and fix offset to report correctly 2003-12-03 01:31:56 +00:00
Sara Golemon
3d6fcddfd2 Restore ability to use strrpos/strripos with an ordinal needle 2003-12-03 01:11:36 +00:00
Ilia Alshanetsky
5a4dda42e3 Optimize substr_replace (this makes it 3-8 times faster depending on the
string length).
2003-12-01 23:17:22 +00:00
Ilia Alshanetsky
cd482c502c Removed dead code. 2003-11-27 01:08:42 +00:00
Ilia Alshanetsky
ab7ee13670 Added substr_compare(). 2003-10-30 00:49:33 +00:00
Moriyoshi Koizumi
103b3c6626 Simplification. 2003-09-29 02:23:40 +00:00
Sara Golemon
ef7905a188 Bug Fix#25671 Corruption in subarrays in subject when using str_replace 2003-09-26 17:57:13 +00:00
Sascha Schumann
36ac7a5bb0 MFB Avoid zero-length keys which result in a spinning process 2003-09-20 16:10:49 +00:00
Sara Golemon
3560cd83c0 Squelch warning "Variable may be used uninitialized."
This would never occur anyway because of the logic of the function,
but gcc isn't quite smart enough to realize this.
2003-08-27 00:43:54 +00:00
Ilia Alshanetsky
ed40ae2650 emalloc -> safe_emalloc 2003-08-11 23:16:54 +00:00
Sara Golemon
3caa0d0aa9 Fix Bug#24784 single character search keys not respecting case sensitivity/replace count parameters. 2003-07-25 01:03:39 +00:00
Moriyoshi Koizumi
4b07cb98b1 Fixed bug #24556 2003-07-12 09:33:31 +00:00
Stanislav Malyshev
baa3892fe1 Fix #24281 - str_replace not updating the count if value is
not initialized
2003-06-23 14:09:14 +00:00
Sara Golemon
4c52cf5f90 When skipping blank searchvals we should advance the corresponding replace hash as well 2003-06-20 15:41:43 +00:00
Ilia Alshanetsky
b5dc8f918e fixed proto 2003-06-11 02:16:19 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Ilia Alshanetsky
aec7815e9c Fixed bug #24098 (Crash in pathinfo() due to double var initialization).
# This is a php5 specific bug, no MFB needed
2003-06-09 18:12:36 +00:00
Melvyn Sopacua
e4006659b2 MFB: LC_MESSAGES support 2003-05-27 00:42:39 +00:00
Ilia Alshanetsky
2e361db1fe Fixed bug #23788 (str|preg_replace clober the array elements).
# Should this be MFBed to 4.3 branch?
2003-05-25 21:48:57 +00:00
Sterling Hughes
24eee37fed seems there is only the stupid way to be stupid (implode copying array
elements)
at least we check for IS_STRING, which should clear this up 90% of the time
2003-05-21 17:44:08 +00:00
Sterling Hughes
90ae4e0095 be stupid, but at least be smart about being stupid. 2003-05-21 17:38:17 +00:00
Sterling Hughes
8d5c30c14b make brian happy 2003-05-21 16:52:09 +00:00
Sara Golemon
8924395720 MFB(r-1.333.2.27) Bugfix 23654. If subject is an array and it contains other arrays, we want to pass those subarrays through unchanged rather than attempt to convert them to string. 2003-05-16 23:30:08 +00:00
Moriyoshi Koizumi
8cbb6b6341 Fixed bug #23650 (strip_tags() removes hyphens) 2003-05-16 06:19:51 +00:00
Hartmut Holzgraefe
e6490c4a41 basename() now binary safe, testcases added 2003-05-05 13:46:14 +00:00
Moriyoshi Koizumi
b44ae54bc6 Real fix and a test case for bug #22008 2003-05-04 12:44:36 +00:00
Moriyoshi Koizumi
e9c903ad3f A quick fix for bug #22008
# BTW I'm working on an enhanced strip_tags implementation with re2c, which
# will feature more CSS awareness and more stateful scanning.
2003-05-04 11:45:58 +00:00
Andrey Hristov
a894bf5c87 Extending substr_replace().
Every parameter can be mixed (string/array) also the return type.
#see the test file if you need more info.
2003-05-02 10:02:40 +00:00
Wez Furlong
89503b163e Fix dirname() under win32.
The calculated length would be off-by-two under windows, which resulted in bogus dirnames.
2003-04-29 13:35:48 +00:00
Ilia Alshanetsky
7f8bd25fcc Fixed bug #23225 (money_format() didn't handle erroneous return of strfmon)
# Initial patch proposed by marcot@tabini.ca
2003-04-16 01:07:03 +00:00
Sara Golemon
9103aac254 Modify str_replace/str_ireplace to report how many needles were matched. (FR #8218) 2003-04-13 22:59:19 +00:00
Moriyoshi Koizumi
fa0ac8a273 Made dirname() binary-safe. 2003-04-12 21:53:46 +00:00
Sara Golemon
76965beb04 Add tests for strrpos/stripos, and minor fix to maintain BC for condition with empty needles/haystacks 2003-04-12 20:04:06 +00:00
Sara Golemon
0b5c1112c5 Rewrite strrpos and strripos to be binary safe and behave the way their prototype suggests (also like their counterparts strpos and stripos) i.e.: Allow string needles rather than just characters 2003-04-12 07:36:22 +00:00
Derick Rethans
6412e65bf9 - CS 2003-04-03 06:21:59 +00:00
Rasmus Lerdorf
1612ffad05 MFB: Fix the setlocale() segfault 2003-04-02 21:33:02 +00:00
Ilia Alshanetsky
aab9718253 Fixed possible integer overflow in str_repeat(). 2003-04-02 00:25:45 +00:00
Moshe Doron
31bd24860c revert last commit for now 2003-04-01 12:46:01 +00:00
Moshe Doron
dc8daad70d fix for 22904
@ now addslashes() do it also on cybase magic mode(moshe).
2003-03-31 18:56:41 +00:00
Moshe Doron
5c3a073c07 # unnecessary condition here. 2003-03-31 12:08:31 +00:00
Stig Bakken
0e6fca4f22 * email address change 2003-03-18 12:06:09 +00:00
Derick Rethans
0d603b2d9a - Fix proto 2003-03-09 00:05:48 +00:00