Commit Graph

4588 Commits

Author SHA1 Message Date
Ilia Alshanetsky
a24cb8773f MFB51: Fixed an unlikely, but possible memory leak. 2006-04-03 13:46:35 +00:00
Antony Dovgal
0b0fff07b2 fix spelling in error messages:
greater/less thEn -> greater/less thAn
2006-04-03 09:14:50 +00:00
Sara Golemon
53450fae8a Update tests for working with unicode 2006-04-03 05:57:40 +00:00
Sara Golemon
b2523b29b8 Update filename handling and mark various functions for unicode safety 2006-04-01 00:05:31 +00:00
Sara Golemon
fd606a8d78 Add API hooks and unicode.filesystem_encoding for handling unicode
conversions of filename entries.

Normal path conversions will simply use this converter,
Certain other protocols (such as http) which specify a
required character set (utf8), may override the conversion
by defining a path_encode() and/or path_decode() wrapper ops method.
2006-03-31 22:51:37 +00:00
Antony Dovgal
ec376e510c MF51: fix compile failure with old GCC (see bug #36931) 2006-03-31 11:11:26 +00:00
Antony Dovgal
4f1da95828 fix TSRM build 2006-03-30 19:59:51 +00:00
Ilia Alshanetsky
0f48af3cec MFB51: Fixed XSS inside phpinfo() with long inputs. 2006-03-30 19:16:28 +00:00
Sara Golemon
51b9a0f269 Make php_stream_copy_to_mem() unicode aware and
update userspace function file_get_contents().

Note: fgc()'s second parameter (use_include_path) has been changed
to be a bitmask "flags" parameter instead.

For the most commonly used values (TRUE, 1) this will continue functioning
as expected since the value of FILE_USE_INCLUDE_PATH is (coincidentally) 1.
The impact to other values should be noted in the migration6 guide.

This change makes it possible to allow fgc() to return binary file
contents (default) or unicode transcoded contents (using FILE_TEXT flag).
2006-03-30 00:22:51 +00:00
Sara Golemon
1c97a0d78c Update php_stream_passthru() to handle unicode data.
This updates userspace functions fpassthru() and readfile()

UG(output_encoding) is used by php_stream_passthru() to translate
unicode stream contents back to an outputable character set.

Note: readfile()'s second parameter (use_include_path) has been changed
to be a bitmask "flags" parameter instead.

For the most commonly used values (TRUE, 1) this will continue functioning
as expected since the value of FILE_USE_INCLUDE_PATH is (coincidentally) 1.
The impact to other values should be noted in the migration6 guide.

This change makes it possible to allow readfile() to output binary file
contents (default) or unicode transcoded contents (using FILE_TEXT flag).
2006-03-29 22:52:24 +00:00
Andrei Zmievski
d57e79782e Bug! 2006-03-29 05:56:06 +00:00
Sara Golemon
30a2bd1d11 Another (and hopefully last) major streams commit.
This moves unicode conversion to the filter layer
(rather than at the lower streams layer)
unicode_filter.c has been moved from ext/unicode to main/streams
as it's an integral part of the streams unicode conversion process.

There are now three ways to set encoding on a stream:

(1) By context
$ctx = stream_context_create(NULL,array('encoding'=>'latin1'));
$fp = fopen('somefile', 'r+t', false, $ctx);

(2) By stream_encoding()
$fp = fopen('somefile', 'r+');
stream_encoding($fp, 'latin1');

(3) By filter
$fp = fopen('somefile', 'r+');
stream_filter_append($fp, 'unicode.from.latin1', STREAM_FILTER_READ);
stream_filter_append($fp, 'unicode.to.latin1', STREAM_FILTER_WRITE);

Note: Methods 1 and 2 are convenience wrappers around method 3.
2006-03-29 01:20:43 +00:00
Ilia Alshanetsky
75c7f810ea MFB51: Check 2nd parameter of tempnam() against path components. 2006-03-27 23:41:05 +00:00
Andrei Zmievski
e85495f6f1 Fix UErrorCode check. 2006-03-27 23:05:38 +00:00
Andrei Zmievski
d761aa7eb2 Typo. 2006-03-27 22:16:53 +00:00
Andrei Zmievski
626be75d6c Make a UTODO note. 2006-03-27 21:19:12 +00:00
Andrei Zmievski
a8c291f8fe Proto updates. 2006-03-27 19:24:18 +00:00
Dmitry Stogov
d1d9ce8fed Test for strtr() with non-ascii encoding 2006-03-27 14:37:14 +00:00
Dmitry Stogov
9d9adb2f35 Unicode support 2006-03-27 14:19:18 +00:00
Dmitry Stogov
c744d73d04 Unicode support 2006-03-27 13:37:47 +00:00
Dmitry Stogov
06cfa710b4 Fixed testFixed testFixed testFixed testFixed testFixed testFixed testFixed testFixed test 2006-03-27 10:15:02 +00:00
Dmitry Stogov
bdfa3b1d36 Fixed ZTS build 2006-03-27 06:02:42 +00:00
Ilia Alshanetsky
3bf02bde43 MFB51: Fixed bug #36857 (Added support for partial content fetching to the
HTTP streams wrapper).
2006-03-26 17:12:26 +00:00
Derick Rethans
ad6a972de3 - Implemented basic collation support. For some reason "new Collator" gives segfaults when the object's collation resource is used.
- The following example shows what is implemented:

<?php
$orig = $strings = array(
    'côte',
    'cote',
    'côté',
    'coté',
    'fluße',
    'flüße',
);

echo "German phonebook:\n";
$c = collator_create( "de@collation=phonebook" );
foreach($c->sort($strings) as $string) {
    echo $string, "\n";
}
echo $c->getAttribute(Collator::FRENCH_COLLATION) == Collator::ON
    ? "With" : "Without", " french accent sorting order\n";

echo "\nFrench with options:\n";
$c = collator_create( "fr" );
$c->setAttribute(Collator::CASE_FIRST, Collator::UPPER_FIRST);
$c->setAttribute(Collator::CASE_LEVEL, Collator::ON);
$c->setStrength(Collator::SECONDARY);
foreach($c->sort($strings) as $string) {
    echo $string, "\n";
}
echo $c->getAttribute(Collator::FRENCH_COLLATION) == Collator::ON
    ? "With" : "Without", " french accent sorting order\n";
?>
2006-03-26 11:06:24 +00:00
Sara Golemon
a64789a452 Expand stream_context_create() to allow specifying params
as well as options.  Ignore the internal name change of the first arg.
The first arg is still for options, the second arg is for actual params.
2006-03-26 04:40:11 +00:00
Derick Rethans
3df5f17231 - Commit intermediate work so that I can hack on it on some plane. 2006-03-26 02:15:47 +00:00
Sara Golemon
f67ed7f3d4 Allow bidirectional encoding option via single context param 2006-03-24 22:27:13 +00:00
Sara Golemon
dfc827d108 Fix stream_get_line():
Checking type isn't nearly as important as checking nullness...
2006-03-24 21:37:42 +00:00
Sara Golemon
0b2b16e6c7 Update fgetss() for unicode 2006-03-24 21:32:39 +00:00
Sara Golemon
880dd406f2 Add php_stream_get_record_unicde() API call.
Update stream_get_line() userspace function to handle unicode streams.
2006-03-24 19:22:24 +00:00
Ilia Alshanetsky
96afde2af7 MFB51:
Added myself to PDO and PDO_MySQL credits
Added Wez to PDO_MySQL credits
Added Tony to Q&A team credits
Regenerated the credits file
2006-03-23 18:39:12 +00:00
Antony Dovgal
932c5d9e0e MF51: prevent segfault when exception is thrown from Countable::count() 2006-03-22 22:06:08 +00:00
Antony Dovgal
a4c6a19335 use set_time_limit(), this test takes forever on AIX 2006-03-22 19:27:28 +00:00
Derick Rethans
3056defb26 - Moved strtotitle to ext/standard and implemented the fallback case to
non-unicode with ucwords. There is also an implementation for unicode ucwords
  but that returns different results then strtotitle as it uppercases the
  first character of every word, and doesn't *titlecase* a word. The test case
  shows that.
2006-03-22 10:20:20 +00:00
Ilia Alshanetsky
f7875f813c MFB51: Fixed bug #36689 (Removed arbitrary limit on the length of syslog
messages).
2006-03-21 00:59:41 +00:00
Antony Dovgal
c2eabef473 shutdown syslog module before freeing basic_globals 2006-03-20 23:33:07 +00:00
Antony Dovgal
6901e09492 MF51: fix #36808 (syslog ident becomes garbage between requests) 2006-03-20 23:07:31 +00:00
Antony Dovgal
1df7e13f48 fix #36741 (userstreams testcase have off-by-one error on fseek()) 2006-03-20 22:08:59 +00:00
Antony Dovgal
ba1ac82bc9 don't leak memory even though the code is not stable yet 2006-03-20 20:09:20 +00:00
Antony Dovgal
9557d44ed8 fix buffer overrun 2006-03-20 14:10:23 +00:00
Antony Dovgal
2c750d7f84 make the code a bit cleaner - no need for two different checks that are doing effectively the same 2006-03-19 22:12:39 +00:00
Marcus Boerger
792e4d9f4d - Fix TSRM 2006-03-17 23:14:55 +00:00
Andrei Zmievski
25b95e4250 Make is_string() return TRUE for both Unicode and binary strings. 2006-03-17 23:00:20 +00:00
Andrei Zmievski
a75b8f5f35 Fix compiler errors by using NULL_ZSTR where zstr is expected.
# I guess we need to use NULL_ZSTR instead of NULL when passing NULL to
# functions that expect zstr parameter.
2006-03-17 22:52:55 +00:00
Andrei Zmievski
6b165251db Calculate the size of the tmp[] buffer directly at compile time. 2006-03-17 22:51:20 +00:00
Derick Rethans
c6b425432a - Actually make this is_binary() too. 2006-03-17 14:53:57 +00:00
Derick Rethans
2ffc93140d - Fixed bug in ucfirst() implementation. If the tmp_len = 0 then it will not
write the uppercased character to the buffer, but only returns the length of
  the uppercased letter as per
  http://icu.sourceforge.net/apiref/icu4c/ustring_8h.html#a50.
- Updated is_string():
  If Unicode semantics is turned on, return "true" for Unicode strings only.
  If Unicode semantics is turned off, return "true" for native strings only.
- Added is_binary() function that returns "true" for native strings only.
- Added first implementation of upgraded strtr function. It works except if
  combining sequences or surrogates are used in the non-array method of calling
  this function.
2006-03-17 14:29:05 +00:00
Dmitry Stogov
86780519d4 Disabled dl(). Now it is enabled only when a SAPI layer registers it explicitly. Only CLI, CGI and EMBED do this. 2006-03-16 16:53:10 +00:00
Dmitry Stogov
9d7ca01c8b Dropped allow_call_time_pass_reference, the error is maden E_STRICT. 2006-03-16 11:32:00 +00:00
Derick Rethans
c76917a773 - Fixed two memory issues:
- In the first one we were calculating the tmp_len wrong which made the
	u_strFromUTF32() function try to convert too many code points.
  - The second issue was a bit more subtle as the "what" string wasn't
	duplicated but still modified. This string is passed as data to the
	function and this kind of data the engine tries to free when the function
	ends. Because we were re-allocating the data the original memory location
	was already freed resulting in a double free error when the engine tries to
	free the argument as it was passed to the function.
2006-03-15 12:20:49 +00:00