Commit Graph

239 Commits

Author SHA1 Message Date
Marcus Boerger
6380908706 - Fix warning 2006-03-16 00:53:58 +00:00
Sara Golemon
1eca7b87d1 Fix improper byte count on partial reads 2006-03-15 21:18:36 +00:00
Sara Golemon
df77705572 Switch (zstr) casts to use ZSTR() macro. 2006-03-15 00:28:57 +00:00
Sara Golemon
b576354982 More stream updates.
fgets() will work now as will anything which calls one of the
_php_stream_get_line() family of functions.
The one exception here is when the legacy defines are used on a unicode
stream.  At the moment they'll simply return NULL, I'll update these
to do sloppy conversion in a bit.

'make (u)test' still doesn't work, but it's a different doesn't work.
2006-03-14 21:15:05 +00:00
Sara Golemon
04df7e3bdc Make php_stream_write_buffer() return characters written, not bytes 2006-03-13 20:54:06 +00:00
Derick Rethans
f7bfe18307 This makes file_put_contents() work for:
<?php
    declare(encoding="latin1");
    $a = "1234å67890";
    file_put_contents( "/tmp/testuc.1", $a);
    file_put_contents( "/tmp/testuc.2", (string) $a);

    $context = stream_context_create();
    stream_context_set_params($context, array( "output_encoding" => "latin1" ) );
    file_put_contents( "/tmp/testuc.3", $a, FILE_TEXT, $context);
    file_put_contents( "/tmp/testuc.4", (string) $a, FILE_TEXT, $context);
?>

But it still throws a warning on ".3". It's a small design issue that I
didn't want to touch right now.
2006-03-13 15:01:44 +00:00
Sara Golemon
48798021b5 Refactor streams layer for PHP6.
Don't be frightened by the size of this commit.
A significant portion of it is restoring the read buffer semantics back
to what PHP4/5 use.  (Or a close aproximation thereof).

See main/streams/streams.c and ext/standard/file.c for a set of
UTODO comments covering work yet to be done.
2006-03-13 04:40:11 +00:00
Ilia Alshanetsky
27e175eef0 So long safe_mode mode.
Also removed the magic_quotes configure option, no longer relevant since
the magic is gone :-).
2006-03-08 14:41:45 +00:00
Dmitry Stogov
c366cc6d1a Nuke int32_t (everywhere except streams layer) and signed/unsigned warnings 2006-03-02 13:12:45 +00:00
Marcus Boerger
56ec57c614 - If (SEEK_CUR,0) means an illegal seek we return -1 to denote the error 2006-02-28 18:00:03 +00:00
Marcus Boerger
6531669e4e - Cleanup 2006-02-28 12:06:54 +00:00
Dmitry Stogov
0f1209ab3d Portable unicode string API:
- use the same type (int) for zval.value.usr.len and zval.value.str.len
  - use union "zstr" as char*/UChar* mixture instead of void*
  - Z_UNISTR() and Z_UNILEN() no longer check for Z_TYPE()
  - nuke int32_t from ZE (not finisned)
2006-02-21 20:12:43 +00:00
Andi Gutmans
1efe984d08 - Get rid of using ENFORCE_SAFE_MODE. 2006-02-19 04:29:42 +00:00
Andi Gutmans
8f126f33ac - Fix according to Sara's reply 2006-02-19 03:41:25 +00:00
Andi Gutmans
d3f7bee047 Nuke php_check_safe_mode_include_dir 2006-02-19 01:19:37 +00:00
Andi Gutmans
e3b1e8c5dd - Some more safe_mode nuking 2006-02-19 01:10:13 +00:00
Sara Golemon
ff87d57268 Prevent bindport from being used uninitialized 2006-02-02 18:16:25 +00:00
Dmitry Stogov
227295a4f1 Unicode stuff is changed according to decision maden on PDM.
Now IS_BINRAY data type is removed and IS_STRING starts behave as IS_BINARY in unicode mode. IS_STRING is incompatible with IS_UNICODE, so ALL functions should be improved to support unicode mode.
2006-01-17 12:18:53 +00:00
Ilia Alshanetsky
1204ea0e63 MFB51: Only report mkdir() errors if error reporting option is set. 2006-01-17 02:32:34 +00:00
Antony Dovgal
07ff99a075 fix bug #35999 (recursive mkdir() does not work with relative path like "foo/bar") 2006-01-16 19:47:07 +00:00
Marcus Boerger
095c66e715 - Fix two warnings
# Here fixing warnings reveals that it often enough means fixing errors
2006-01-12 19:21:36 +00:00
Marcus Boerger
d6e15bf75e - Fix warning 2006-01-12 19:13:50 +00:00
Ilia Alshanetsky
d2397a9301 MFB51: Fixed bug #35916 (Duplicate calls to stream_bucket_append() lead to
a crash).
2006-01-10 16:14:45 +00:00
Marcus Boerger
71af00ec47 - Fix issue with memset seeking
- Fix issue with shutdown order of temp/memory stream
2006-01-05 22:05:44 +00:00
foobar
251c5173fd bump year and license version 2006-01-01 13:10:10 +00:00
Antony Dovgal
1c7661a301 MFB: fix #35781 (stream_filter_append() can cause segfault) 2005-12-23 15:05:42 +00:00
Antony Dovgal
3a14188725 MFB: fix #35740 (memory leak when including a directory) 2005-12-20 09:48:24 +00:00
foobar
34ad5ab731 - list_entry -> zend_rsrc_list_entry 2005-12-05 23:31:09 +00:00
Rasmus Lerdorf
e1f1857978 Add allow_url_include to let people turn on allow_url_fopen without also
enabling remote code execution through url wrappers
2005-11-18 16:20:43 +00:00
Antony Dovgal
a5e2f63d68 fix #35079 (stream_set_blocking(true) toggles, not enables blocking)
patch by askalski at gmail dot com
2005-11-17 14:19:06 +00:00
Marcus Boerger
7c25bdfe67 - Fix mode handling 2005-10-30 17:17:44 +00:00
Wez Furlong
58f42f04ad merge VCWD_ACCESS bugfix to head.
Test suite is unusable in HEAD, so I guess it works here too.
2005-10-22 17:26:16 +00:00
Marcus Boerger
8217f84488 - C vs. C++ fix
# I do too much C++ and too much languages anyway, right now actively:
# C, C++, Java, PHP, Peral
2005-10-07 07:37:37 +00:00
Marcus Boerger
a27f5b0665 - Fix issue (endless loop) with temp/memory streams 2005-10-06 21:30:56 +00:00
Antony Dovgal
5e72a7c750 fix fwrite() and fgets() in unicode mode 2005-10-05 21:46:28 +00:00
Antony Dovgal
6f4fe0e7ff fix bugs #34743 & #34118 (fseek/fread unicode related problems in HEAD)
patch by Alex
2005-10-05 17:18:06 +00:00
Derick Rethans
cdcf566a21 - Fixed a bug where stream_get_meta_data() did not return the "uri" element for
files opened with tmpname().
2005-08-26 12:50:06 +00:00
Dmitry Stogov
83bd44f1fd Don't apply "unicode" filters in non-unicode mode 2005-08-22 14:48:25 +00:00
Wez Furlong
7d44da10b6 tidy up implicit_mode handling; spotted by Nuno
There's probably a much more efficient way to do this than the current strchr stuff.
2005-08-14 13:48:29 +00:00
Wez Furlong
b282b4d1ec a bit of pedantic ws 2005-08-13 19:22:03 +00:00
Antony Dovgal
6bd0350af8 make valgrind and gcc happy 2005-08-12 23:21:29 +00:00
Andrei Zmievski
264cec8be6 Unicode support. 2005-08-11 23:36:07 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Wez Furlong
8c57c3a9fe compile before commit (gah!) 2005-07-18 14:12:52 +00:00
Wez Furlong
c4ba9edd57 Apparently our pipe detection code just above this isn't foolproof.
Catch it here.
2005-07-18 13:28:24 +00:00
Marcus Boerger
7316ee0399 - Fix problem with debug mode on selective machines 2005-07-17 18:39:24 +00:00
Ilia Alshanetsky
87d6f497f7 Likely fix for bug #33140 2005-06-24 02:04:19 +00:00
Ilia Alshanetsky
3b79941168 Fixed bug #31054 (safe_mode & open_basedir checks only check first
include_path value).
2005-06-20 15:59:13 +00:00
Sebastian Bergmann
1d9baf3dd5 ZTS fix. 2005-06-14 05:13:01 +00:00
Ilia Alshanetsky
b36d4ae02c Added bindto socket context option. 2005-06-14 02:39:42 +00:00