Commit Graph

2404 Commits

Author SHA1 Message Date
Ilia Alshanetsky
ed9e8c7c81 Fixed bug #31440 ($GLOBALS can be overwritten via GPC when register_globals
is enabled).
2005-02-17 04:44:11 +00:00
Ilia Alshanetsky
7ee1fdb657 Prune uploaded file names to \ on all OSes, read comments for explanation. 2005-02-15 00:25:38 +00:00
Anantha Kesari H Y
3c1e2e15b8 NetWare Libc has php.h so no need of having netware specific block here 2005-02-14 11:10:07 +00:00
Wez Furlong
0569078901 Avoid bug where stream_copy_to_stream() call for precisely 2000000 bytes would
result in entire resource being copied.
The mmap brake is already present inside mmap_range() and is set to 1MB.
2005-02-06 23:17:09 +00:00
Wez Furlong
f400f0e665 add an open mode for the memory streams that allows the stream to take
ownership of the passed-in buffer
2005-02-06 21:41:36 +00:00
Ilia Alshanetsky
e55938b6a8 Fixed bug #31514 (open_basedir uses path_translated rather then cwd for .
translation).
2005-02-02 23:43:17 +00:00
Ilia Alshanetsky
d179e6aa40 Final version of filename upload handling. 2005-02-01 02:33:07 +00:00
Ilia Alshanetsky
71695f8159 Use multibyte specific code for handling files and generic basename based
code in all other instances.
2005-01-24 22:35:23 +00:00
Moriyoshi Koizumi
76d91f2a3d - Revert irrelevant part. 2005-01-24 16:47:18 +00:00
Ilia Alshanetsky
844cc09cd1 Fixed bug #31398 (When magic_guotes_gpc are enabled filenames with '
get cutoff).
2005-01-20 17:44:58 +00:00
foobar
14058c83e6 - Fix another generated header include 2005-01-14 20:44:28 +00:00
foobar
a139dbf9cc - Fix outside-source-tree builds. Always include generated header files
with #include <some_header.h> to make sure the correct file is used.
2005-01-09 21:05:06 +00:00
foobar
6ffb0dcaf2 - Fix leaks with registered shutdown functions. 2005-01-09 16:30:09 +00:00
Wez Furlong
63ee853b74 bump PHP API number.
This is so that we can work around the signature change in the get_method
overloaded object handler in our portable extensions.

Yes, you could argue that the zend api number needs bumping, but then you could
argue which one to bump, as neither of them is specific or generic enough.

Besides all that, the PHP API number really needs a good old bump anyway.
2004-12-26 04:46:09 +00:00
Derick Rethans
6386777fe3 - MF43: Fixed weird types, this also makes it compile on IRIX again. 2004-12-17 13:08:44 +00:00
Andi Gutmans
4e942cb07f - Fix bug #27728 (Can't return within a zend_try{} or the previous
state isn't restored.
2004-12-10 22:59:25 +00:00
Stefan Esser
b1bb6f1735 Do not silently truncate 2004-12-01 22:37:33 +00:00
Stefan Esser
c02b2d2d45 Fixed: Correctly Initialize fields 2004-11-28 13:32:29 +00:00
Stefan Esser
6d98fc38b5 Fixed: removed possible integer over-/underflows 2004-11-28 12:44:28 +00:00
Stefan Esser
224201e635 Fixed: strip quotes from filename 2004-11-20 18:49:36 +00:00
Ilia Alshanetsky
d98a44d483 Fixed bug #29801 (Set limit on the size of mmapable data). 2004-11-15 23:43:12 +00:00
Frank M. Kromann
816bcd3aff Fix win32 build. 2004-11-15 21:04:09 +00:00
Derick Rethans
61364b5bb1 - MFH4.3: Cleaned up some of the locale mess:
* all internal use of sprintf, snprintf and the like will always
    use the . as thousands seperator (if php.h is included only!).
  * echo, printf() and sprintf() always render locale-aware
  * added the %F modifier for non-locale aware rendering for floats
2004-11-15 13:42:22 +00:00
Rob Richards
d563495a24 add support for file://localhost/
support file:/// under windows again
2004-11-11 13:08:32 +00:00
Ilia Alshanetsky
f41c40f63e Fixed bug #30750 (Meaningful error message when upload directory is not
accessible).
2004-11-11 00:38:04 +00:00
Andrey Hristov
494d665955 make sleep() return it's return value when possible
#on some *nix systems sleep() is implemented with SIGALRM. When SIGALRM
#interrupts sleep() it returns the number of seconds that has to be slept
#till the number of seconds wanted by the script. Sleep() on Windows is
# void.
2004-11-02 17:03:20 +00:00
Antony Dovgal
aa35b11afe fix Win32 & Netware build 2004-10-28 05:05:20 +00:00
Antony Dovgal
ceacc834fb fix bug #30388 (rename across filesystems loses ownership and permission info) 2004-10-27 11:58:49 +00:00
Ilia Alshanetsky
0802b1286d Make request start time be available via $_SERVER['REQUEST_TIME'].
# As discussed on internals.
2004-10-24 17:41:13 +00:00
Stanislav Malyshev
f799da0a21 MF4: fix double bailout in HEAD when output is attempted from shutdown 2004-10-20 15:31:06 +00:00
Antony Dovgal
e865bc2bc5 fix bug #30442 ( segmentation fault when parsing ?getvariable[][ ) 2004-10-18 15:05:06 +00:00
Anantha Kesari H Y
5bf2be3461 removing inclusion of platform specific config files as they are already included from php_scandir.h 2004-10-18 10:42:16 +00:00
Anantha Kesari H Y
6021286c5d removing php_output_activate Fix for bug#30397 2004-10-18 10:26:45 +00:00
Derick Rethans
3b2879b3c1 - Revert patch until it is discussed 2004-10-18 06:04:02 +00:00
Anantha Kesari H Y
d5eb399b5e Fix for Bug #30397 2004-10-16 10:32:42 +00:00
Ilia Alshanetsky
5c04e39383 Fixed bug #30362 (stream_get_line() not handling end string correctly). 2004-10-11 18:31:49 +00:00
Wez Furlong
b7182e85c7 Fix the return value check too 2004-10-11 01:40:41 +00:00
Wez Furlong
7cb4e769ff check the correct flag for async connect 2004-10-11 01:30:19 +00:00
Christian Stocker
bd99d77bf6 - Fixed bug #27183 (Userland stream wrapper segfaults on stream_write)
Was applied to PHP 4 ages ago, but not to PHP 5 branch
2004-10-08 14:40:11 +00:00
Anantha Kesari H Y
940c5b393d removed unwanted NEW_LIBC checks for NETWARE and removing custom mktemp.h as LibC itself supports mkstemp functionality 2004-10-07 12:22:16 +00:00
Anantha Kesari H Y
1d7a8a9e69 removed unwanted NEW_LIBC checks 2004-10-06 13:22:21 +00:00
Andi Gutmans
216853c0db - Apply realpath() cache patch. We don't use it if we're in safe_mode and
- friends (which are quite slow anyway).
- If it proves to be stable I'll remove the #ifdef's in a few weeks.
2004-10-05 00:42:25 +00:00
Anantha Kesari H Y
ee43ab18b0 enabling few functionalities as the LibC starts supporting them 2004-09-30 15:55:18 +00:00
Anantha Kesari H Y
93be400da9 Including config.nw.h file for NetWare 2004-09-30 14:46:03 +00:00
Marcus Boerger
854b3ebdc3 - Add missing macro 2004-09-30 08:03:38 +00:00
Anantha Kesari H Y
379bb867cb NetWare LibC don't have search.h 2004-09-29 16:11:47 +00:00
Anantha Kesari H Y
5dbf49e314 removed unwanted NEW_LIBC checks 2004-09-29 14:42:16 +00:00
Anantha Kesari H Y
06a4be43a3 NetWare don't have uid for a file so modified the php_checkuid to return 1 for NetWAre 2004-09-29 12:35:13 +00:00
Anantha Kesari H Y
b38de145ac removed unneccessary inclusion of headers for NetWare 2004-09-29 12:25:56 +00:00
Anantha Kesari H Y
a93f75ce6b NETWARE has a proper stat structure Now no need of CLIB_STAT_PATCH checks 2004-09-29 10:54:56 +00:00
Anantha Kesari H Y
0903dcdcf7 removed redundant NEW_LIBC checks for NETWARE 2004-09-29 10:36:24 +00:00
Anantha Kesari H Y
c914bff745 removed unwanted NetWare specific changes 2004-09-23 15:57:30 +00:00
Anantha Kesari H Y
9b0489ac47 removed redundant checks for NETWARE 2004-09-23 15:43:54 +00:00
Anantha Kesari H Y
b855337d39 CLIB_STAT_PATCH check is redundant. So removing it 2004-09-23 13:07:43 +00:00
Wez Furlong
ff4e970fb1 Make new poll stuff work on win32 (and still be safe on unix) 2004-09-17 14:36:55 +00:00
Wez Furlong
99e290f882 Fix for Bug #24189: possibly unsafe select(2) usage.
We avoid the problem by using poll(2).

On systems without poll(2) (older bsd-ish systems, and win32), we emulate
poll(2) using select(2) and check for valid descriptors before attempting
to access them via the descriptor sets.

If an out-of-range descriptor is detected, an E_WARNING is raised suggesting
that PHP should be recompiled with a larger FD_SETSIZE (and also with a
suggested value).

Most uses of select(2) in the source are to poll a single descriptor, so
a couple of handy wrapper functions have been added to make this easier.

A configure option --enable-fd-setsize has been added to both the unix and
win32 builds; on unix we default to 16384 and on windows we default to 256.
Windows FD_SETSIZE imposes a limit on the maximum number of descriptors that
can be select()ed at once, whereas the unix FD_SETSIZE limit is based on the
highest numbered descriptor; 256 should be plenty for PHP scripts under windows
(the default OS setting is 64).

The win32 specific parts are untested; will do that now.
2004-09-17 12:44:56 +00:00
Ilia Alshanetsky
2a2d49b947 Fixed bug #30050 (Possible crash inside php_shutdown_config()).
# Patch suggestion by nw at softwarekombinat dot de
2004-09-17 02:48:41 +00:00
Sara Golemon
34550382d8 Added stream_filter_remove() to cancel a stream filter.
Register filters as resources when
instantiated by stream_filter_(ap|pre)pend().

Export php_stream_filter_flush() internal function to wind buffered data
out of a particular filter until consumed by a later filter or sent to
stream->readbuffer or stream->ops->write()
2004-09-14 03:48:17 +00:00
Sara Golemon
9cd4320b65 Allocating hash tables should be done via macro, not directly 2004-09-13 21:07:22 +00:00
Stefan Esser
0f860d8f34 only allow valid arrays at this point 2004-09-13 16:00:23 +00:00
Stefan Esser
e7d698c7d8 New Rule: Never try to repair potential malicious user input 2004-09-12 10:45:14 +00:00
Sara Golemon
ed5dcbff9b A little extra code to allow overriding plainfiles wrapper as well 2004-09-10 21:50:29 +00:00
Sara Golemon
955b43ba12 Add stream_wrapper_unregister()
Disables a wrapper (user-defined or built-in) for the life of the request.

Add stream_wrapper_restore()
Restores the wrapper originally defined at the time the request started
to the protocol name mentioned.
2004-09-10 20:45:35 +00:00
Rasmus Lerdorf
bb8167cda3 Stop at the index on an unmatched [ 2004-09-09 16:10:24 +00:00
Sara Golemon
d179ac771c Handle maxlen when stream can't be mmaped 2004-09-08 18:42:15 +00:00
Zeev Suraski
85a36e2bc3 Fix reverse dependency 2004-09-05 22:40:35 +00:00
Joe Orton
0d3884fed1 Move global symbols defined by bundled copy of libgd into private
php_gd_* namespace, to avoid symbol conflicts with, for instance,
another Apache module which loads a different copy of libgd.
2004-08-31 16:41:29 +00:00
Antony Dovgal
fd6d9cbeac fix bug #29723 (file_get_contents() fails with the file:// wrapper under Win32) 2004-08-31 11:37:02 +00:00
Ilia Alshanetsky
c84bd49fb5 Using int when long should be used. 2004-08-22 18:05:24 +00:00
Frank M. Kromann
e398e6b7d6 Fix win32 compilation. Missing uid_t and gid_t definitions. 2004-08-21 03:09:45 +00:00
Brian France
2f97097e0f If you send a post with a content-type header and then the next post without the content-type header, raw_post_data will not be set. This is because SG(request_info).post_entry is set to the first requests function pointer which makes it follow the wrong code path. 2004-08-19 20:26:39 +00:00
Zeev Suraski
b9310261d7 Fix an oldie fd leak 2004-08-16 12:24:52 +00:00
Derick Rethans
566230a01b - Added the PHP_EOL constant (Patch by Paul Hudson) 2004-08-13 07:02:50 +00:00
Rasmus Lerdorf
3166314d89 Reset global request_time in sapi_activate. Reset it in sapi_deactivate
too, although I can't see why that would be necessary, but most of the
other sapi globals are reset there as well.
2004-08-11 06:18:25 +00:00
Sara Golemon
883e096ce6 Minor format specifier fixes 2004-08-11 04:27:01 +00:00
Rasmus Lerdorf
cad60c3760 Add SAPI hook to get the request time if provided by the web server,
otherwise call time(0) on the first call and store it so subsequent
calls will get the same time.  Hook support for Apache1/2 included.
2004-08-10 17:40:00 +00:00
Wez Furlong
b21a7357fc Fix for #29256 from Dmitry, very slightly modified 2004-08-10 13:44:43 +00:00
Wez Furlong
d0be029908 zts fix... 2004-07-31 16:34:44 +00:00
Wez Furlong
ae7285d658 Misc sendto/recvfrom tweaks that have been pending here for a while... 2004-07-31 10:56:55 +00:00
Wez Furlong
05a3fabacb Make sure this is initialized... 2004-07-31 10:49:09 +00:00
Wez Furlong
71078de71a Implement an fstat cache for plain files. 2004-07-31 10:09:25 +00:00
Wez Furlong
f1072c2ae9 Ensure that port numbers get set in the peer/socket name functions.
(duh!)
2004-07-28 23:30:23 +00:00
Wez Furlong
637c424d64 Fix #29431: crash when parsing an invalid network address 2004-07-28 23:15:25 +00:00
Ilia Alshanetsky
86efab2cc4 Fixed bug #29369 (Uploaded files with ' or " in their names get their names
truncated at those characters).
2004-07-25 19:19:26 +00:00
Marcus Boerger
0cd2da0309 - Execute destructors earlier (Florian Schaper, fschaper at intux org) 2004-07-25 07:14:49 +00:00
Edin Kadribasic
4162f81c88 HEAD is 5.1.0-dev now 2004-07-21 23:02:28 +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
Marcus Boerger
7722837517 - Use ErrorException instead of Exception 2004-07-15 22:22:06 +00:00
Andi Gutmans
c18badbfbf - 5.0.1-dev 2004-07-13 19:56:49 +00:00
Andi Gutmans
399e2ca69f - Roll PHP 5.0.0 2004-07-13 19:05:31 +00:00
Wez Furlong
971fcd4254 Looks like Sara forgot to change this too. 2004-07-13 16:34:56 +00:00
Wez Furlong
ae40d0ef2a Fix file_get_contents() bug... 2004-07-12 20:59:24 +00:00
Stefan Esser
0e8de752fd Ooups... 2004-07-11 21:14:50 +00:00
Stefan Esser
8c075de7c7 Fixed: PARSE_TYPE parameter to input_filter
Fixed: input_filter should also be able to filter empty variables by name
2004-07-11 20:13:39 +00:00
Wez Furlong
cd732f1a3f RIP: greedy ready problems
This allows people to use fread($fp, filesize($filename)) for regular files,
but packet-based non-greedy reads for everything else.
2004-07-10 10:54:09 +00:00
Andi Gutmans
e5cfb1d05c - Better stability during premature shutdown of request startup 2004-07-10 07:46:17 +00:00
Wez Furlong
8f435013ff Fix for Bug #28964 fread "greedy" behaviour 2004-06-29 21:51:53 +00:00
Stefan Esser
59d55efb17 As long we pass values by reference this is needed. Ugly! 2004-06-26 08:09:28 +00:00
Sara Golemon
a2c24ae90e BugFix#28868 (Part Two): This fixes thread unsafety in the userspace
filters which relates to the fix just applied for userspace wrappers.
2004-06-21 21:08:05 +00:00
Sara Golemon
7fcfa8865e BugFix#28868: Wrapper hash not thread-safe.
Userdefined wrappers were being registered into a global wrapper hash
which can cross threads.  Termination of once instance then has the
potential to leave an active stream in another instance with no wrapper
leading to segfault.
2004-06-21 18:58:55 +00:00