Marcus Boerger
e2a62e21c2
Fix for cases when new_length is NULL
2002-10-22 18:27:56 +00:00
Andrei Zmievski
92d61459c0
@- Fixed an infinite loop in setlocale() when only invalid locale names
...
@ were passed in the array. (patch by Pal Loberg, pallo@initio.no ).
2002-10-18 13:07:50 +00:00
Ilia Alshanetsky
30c16baac2
Renamed word_count to str_word_count to comply with naming conventions.
...
Thanks Andi, for catching this oversight.
2002-10-17 22:44:44 +00:00
Ilia Alshanetsky
47b57f2569
Added word_count() function that allows counting of words inside a string.
...
The function also allows the user to retrieve all the words from a string.
2002-10-17 03:27:19 +00:00
Sander Roobol
524c9ef26a
Fixed problems with the new nl2br() and beautified the code a little.
...
Closes #19858 .
2002-10-11 12:42:01 +00:00
Ilia Alshanetsky
287b7f9bcb
Switched from localeconv to localeconv_r, which is apparently thread-safe.
2002-10-11 03:19:38 +00:00
Andrey Hristov
cd282dad98
ws fixes
2002-10-10 18:41:24 +00:00
Ilia Alshanetsky
bc14a6f133
This patch fixes handling of floats on locales where decimal point is not a
...
'.'. Problem is best demonstrated by bug #17079 .
2002-10-10 16:29:35 +00:00
Andrey Hristov
868ae8b6e0
ws fixes.
2002-10-09 13:50:06 +00:00
Ilia Alshanetsky
a75eb9c4dd
Optimizations to various php string functions substr_count(), strrev(),
...
nl2br(), php_addslashes() and php_memnstr().
2002-10-09 13:37:02 +00:00
Andrey Hristov
16a82f2b47
Returning to the old behavior of str_shuffle() a bit. Now the passed string is
...
left unmodified and the shuffled string is returned.
2002-10-09 10:33:22 +00:00
Andrey Hristov
0ad8b4aa10
Now str_shuffle() has the randomization characteristics of shuffle().
...
str_shuffle() won't return anymore the randomized string and thus will be
consistent with shuffle(). Since this function is new to 4.3.0 no BC
problems.
#Thanks to Adam Trachtenberg for providing good example to check the
#permuations distribution.
2002-10-08 09:52:59 +00:00
Sander Roobol
004d3d3a30
Fix another leak in implode()
2002-10-06 18:39:03 +00:00
Sander Roobol
68cd067670
Fixed segfault and memory leak in the new implementation of implode()
2002-10-06 11:28:11 +00:00
Sterling Hughes
df837e67c7
have implode use the smart_str_*() functions, this should speed things up
...
quite a bit...
2002-10-04 20:44:19 +00:00
Sander Roobol
e6e2c1c70d
Fixed a bug in the new implementation of str_repeat()
2002-10-04 17:10:51 +00:00
Derick Rethans
ec6713f1ca
- dot :)
2002-10-04 16:55:46 +00:00
Sterling Hughes
5605dcf7b6
fix a memory leak in implode()
...
# kept seperate from last commit on purpose.. ;)
2002-10-04 16:54:56 +00:00
Sterling Hughes
abc9991925
@ Make the glue argument to implode() optional, if it is not specified
...
@ default to using "". (Sterling)
2002-10-04 16:53:14 +00:00
Andrey Hristov
52c529c5af
ws fixes.
...
#again :)
2002-10-03 18:15:18 +00:00
Ilia Alshanetsky
2ea2b662a4
Optimized str_repeat() function, it is now 10x faster on 1 byte multipliers
...
and 5-6x faster on multi-byte multipliers.
2002-10-03 13:59:31 +00:00
Yasuo Ohgaki
f6dfd6b184
Forgot 1 byte for \0
2002-10-03 04:56:54 +00:00
Yasuo Ohgaki
5f1bb18c36
Save memory
2002-10-03 04:54:01 +00:00
Andrey Hristov
83a0f20381
Making strrchr() binary safe.
...
Test case added.
2002-10-02 18:58:09 +00:00
Andrey Hristov
2092d80230
Making strstr() binary safe.
2002-10-02 18:41:55 +00:00
Andrey Hristov
b2d93b67fc
Ws fix. Forgot to add this in the previous commit.
2002-10-02 18:13:56 +00:00
Andrey Hristov
f02b1507dc
ws fixes.
2002-10-02 17:56:04 +00:00
Sebastian Bergmann
fd7326395b
Fix warning.
2002-09-26 19:18:35 +00:00
Andrey Hristov
f80a817f7c
Added common handler for strspn() and strcspn(). Almost of the code is
...
identical. Modified to accept up to 4 params. Last 2 optional start & len.
They are analogic to start & len of substr(). So the behavior when start &
len are used is like
strspn(substr($s,$start,$len),$good_chars) and
strcspn(substr($s,$start,$len), $bad_chars)
2002-09-25 19:06:29 +00:00
Andrey Hristov
fc46a46b06
str_shuffle() function added. Like shuffle() for arrays - however the
...
algorithm for creating the permutation is quite simple. More like
the implementation of shuffle() for 4.2.1 .
2002-09-25 18:06:05 +00:00
Sebastian Bergmann
fd329d2cd1
Fix warning.
2002-09-23 14:20:02 +00:00
Ilia Alshanetsky
8fc94a082f
Fixed bug #7472 as well as many other bugs with strip_tags implementation.
2002-09-21 17:34:06 +00:00
Ilia Alshanetsky
bc8eda5385
Fixed bugs #12989 and #12120
2002-09-20 11:48:47 +00:00
Hartmut Holzgraefe
f8358b44d1
setlocale() will now accept multiple locale arguments, first match wins
2002-09-18 07:55:30 +00:00
foobar
746c147670
tok tok..
2002-09-11 14:51:09 +00:00
foobar
daf6a5ab1a
ws fix
2002-09-11 14:40:52 +00:00
foobar
be52343850
fix proto
2002-09-11 14:24:27 +00:00
Dan Kalowsky
e560822fa7
silence a windows build warning
2002-09-05 21:29:39 +00:00
Ilia Alshanetsky
eb58557e1c
Fixed a buffer overflow that occurs when wordwrap is unable to calculate
...
the correct number of times the multi-byte break needs to be inserted into
the string.
2002-09-05 14:00:28 +00:00
Derick Rethans
60dcc761ac
- php_error -> php_error_docref
...
- corrected proto of implode() (to match the docs)
2002-09-05 11:29:31 +00:00
Hartmut Holzgraefe
101d155baa
in stristr:
...
this check was in the wrong place, the real version was some lines
below, this one assumed the type was 'string' in any case
now it looks like strstr
2002-09-05 11:12:01 +00:00
Ilia Alshanetsky
64ef43ecd4
Slight optimization of php_strtoupper & php_strtoupper functions.
2002-08-25 19:08:07 +00:00
Wez Furlong
c7be7b55d1
Add a "closing" parameter for filters to determine if a flush is the last
...
flush before the stream is closed. This allows filters to finish a chunk
and write footers etc.
2002-08-25 10:26:58 +00:00
Marcus Boerger
149ad05b4f
php_error_docref
...
#New conversion available at: http://docref.txt.marcus-boerger.de
2002-08-24 01:19:28 +00:00
Ilia Alshanetsky
ea1bb5e172
Added monetary.h to prevent compile warning.
...
Fixed a memory leak inside money_format function, which occures if the
parameters to the function are not valid.
Fixed a segmentation fault inside money_format in the event the value
to be formated is >1024 bytes.
Made the return value of money_format be null terminated.
2002-08-21 13:14:57 +00:00
Sebastian Bergmann
090e30a863
Fix ZTS build.
2002-08-21 06:22:19 +00:00
Wez Furlong
9d348ea800
Implement filter API for streams.
...
Filters can be stacked onto a stream; more details will follow in docs and
on php-dev.
Implement "string.rot13" filter
Allows the following script:
$fp = fopen("file.txt", "r");
stream_filter_prepend($fp, "string.rot13");
// File contents will be subject to a rot13 transformation before
// being output.
fpassthru($fp);
fclose($fp);
2002-08-20 20:47:47 +00:00
Hartmut Holzgraefe
e5fa36eee4
added money_format() function
...
this is similar to C-libs strfmon(), using the same format string
semantics but a different function prototype, so i decided to
give it a more speaking name similar to number_format()
2002-08-02 10:08:53 +00:00
Rui Hirokawa
7527bf0c58
made sapi_register_treat_data() to support multibyte input encoding translation without MBSTR_ENC_TRANS and changed php_treat_data to php_default_treat_data.
2002-08-02 06:53:48 +00:00
Rasmus Lerdorf
d56bc7934d
Fix for #18638 (str_rot13 bug)
2002-07-30 10:51:33 +00:00