Commit Graph

191 Commits

Author SHA1 Message Date
David Soria Parra
3bf53aa911 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Cleanup Safe Mode related comment in SG(request_info)
2012-03-31 09:34:25 +02:00
reeze
ff8be9845f Cleanup Safe Mode related comment in SG(request_info) 2012-03-31 09:34:08 +02:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Rasmus Lerdorf
27dd44db95 Fix a couple of warnings. Use %zu to printf a time_t and get_request_time
actually returns a double, not a time_t.
2011-05-16 15:52:31 +00:00
Scott MacVicar
ca378eefa0 Add header_register_callback(), allows a userland function
to be called as all the headers are being sent and after all
of the default headers have been merged.

headers_list(), header_remove() and header() can all be used
inside the callback.

<?php

header('Content-Type: text/plain');
header('X-Test: foo');

function foo() {
  foreach (headers_list() as $header) {
    if (strpos($header, 'X-Powered') !== false) {
      header_remove('X-Powered-By');
    }
    header_remove('X-Test');
  }
}

$result = header_register_callback('foo');
echo "a";
2011-02-03 16:47:28 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Jérôme Loyet
e1b87cce1f - Fixed #52045 (FPM tries to open php.ini from the current dir)
- Add php_ini_ignore_cwd to _sapi_module_struct
2010-11-11 17:24:27 +00:00
Ilia Alshanetsky
f89effd2a8 Updated _SERVER['REQUEST_TIME'] to include microsecond precision. 2010-11-06 17:14:21 +00:00
Pierre Joye
05383a1072 - drop TSRMLS_FETCH in sapi_register_* (won't bring much at runtime :) ) and cleanup/group the upgrade guide, no need of twenty titles for the same change 2010-09-17 08:41:05 +00:00
Kalle Sommer Nielsen
34b631f679 Pass the TSRMS pointers to sapi_module_struct.log_message, this saves some TSRMLS_FETCH() calls in a few of our SAPI's 2010-08-18 13:34:40 +00:00
Andrei Zmievski
f92fae2f66 I am sorry I tried fixing PHP without extensive discussion on the mailing list.
I am sorry I tried fixing PHP without extensive discussion on the mailing list.
I am sorry I tried fixing PHP without extensive discussion on the mailing list.

Hope all the relevant parties are satisfied.
2010-03-18 22:37:25 +00:00
Andrei Zmievski
3220f15ca2 Fix a few problems with large (2G-4G) file uploads. Added
--enable-large-uploads-fix switch because one change was in SAPI.h structure.
2010-03-18 21:07:38 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Stanislav Malyshev
94b7a00760 fix for #47930 2009-04-28 21:30:23 +00:00
Marcus Boerger
88f19296c9 - Add needed include as reported by Pierre 2008-12-31 17:33:05 +00:00
Marcus Boerger
f77719d800 MFH
- Changed dl() to be disabled by default. Enabled only when explicitly
  registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry)
[DOC]
2008-12-31 14:27:09 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Arnaud Le Blanc
8c4151ad72 Added header_remove() (chsc at peytz dotdk, Arnaud)
[DOC] proto void header_remove([string header_name])
      Removes an HTTP header previously set using header()
      The header_name parameter is optionnal, all headers are
      removed if it is not set

[SAPIs] The header_handler callback in sapi_module_struct has
           been changed, it now take a new argument.

           When it is set to SAPI_HEADER_DELETE, sapi_header->header is
           the name of an header, header_handler has to delete it.

           When it is set to SAPI_HEADER_DELETE_ALL, header_handler has
           to delete all headers.

           When sapi_header_op_enum is SAPI_HEADER_ADD or _REPLACE,
           sapi_header->header is in the form "Name: value", header_handler
           has to add or replace the given header.

           In all cases, header_handler must not free sapi_header or
           sapi_header->header. SAPI_HEADER_ADD must be returned if the
           header has been added or replaced, or 0 in other cases.
2008-11-13 10:14:04 +00:00
Rasmus Lerdorf
6c158374ba exit_on_timeout patch
After the sigsetjmp change, this is patch #2 in an effort to get some
sanity restored to signal handling in PHP.

This patch does two things.  First, it makes it possible to reset the
timeout without resetting the signal handlers.  This is important for
cases where an extension may have deferred signals in its MINIT in order
to implement critical sections. It also lays the groundwork for cleaning
up our signal handling and perhaps eventually implementing our own
signal deferring mechanism so we can have true critical sections.

The second thing this does is to make it possible to terminate the current
child process (only for Apache1 at the moment) on a timeout.  There are
a number of extensions that are unhappy about being longjmp'ed out of
and when this happens on a timeout they are left in an inconsistent state.
By turning on exit_on_timeout you can now force the process to terminate
on a timeout which will clean up any hanging locks and/or memory left
hanging after the longjmp.
2008-03-18 21:42:50 +00:00
Dmitry Stogov
240fa244c3 Improved PHP binary size and startup speed with GCC4 visibility control (Nuno) 2008-01-30 09:41:12 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
11750c315d MFH: ws 2007-08-31 07:43:37 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Dmitry Stogov
7d14dad02e MFH: Fixed mess with CGI/CLI -d command line option (now it works with cgi; constants are working exactly like in php.ini; with FastCGI -d affects all requests). 2006-09-19 20:33:12 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Rui Hirokawa
8235a70ef9 added a server variable PHP_AUTH_DIGEST to support HTTP Digest Authentication. 2005-04-04 15:06:36 +00:00
Rasmus Lerdorf
3c0411c496 Fix for bug #32263
This adds proto_num to request_info.  It is defaulted to HTTP 1.0 (1000)
such that it has a valid value even if the underlying sapi doesn't set it
correctly.  It is then used to determine if a 302 or a 303 should be sent
on a Location redirect.  Any non GET/HEAD HTTP 1.1 redirect will get a 303
instead of a 302 to be compatible with the HTTP spec.
2005-03-14 19:25:39 +00:00
Moriyoshi Koizumi
0d7845384f - Fix bug #28568 (known_post_content_types is not thread safe).
# What is eventually necessiated is entire SAPI redesign, I think.
2005-02-21 15:14:02 +00:00
Frank M. Kromann
e398e6b7d6 Fix win32 compilation. Missing uid_t and gid_t definitions. 2004-08-21 03:09:45 +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
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Derick Rethans
630e1692d6 - Fixed standard wrapper for input filter. 2003-11-30 20:07:58 +00:00
Derick Rethans
750b0338bf - Fix sapi_input_filter patch. Returning 1 from the filter handler should
make PHP register the variable, returning 0 shouldn't. The new length of
  the variables being filtered is now returned in the new_val_len argument
  of the function.
2003-11-29 15:24:35 +00:00
Ard Biesheuvel
3d6426ee14 Fix use of EXTERN_C macros 2003-09-02 13:34:23 +00:00
Wez Furlong
ef498a27b8 linkage for C++ 2003-08-18 23:19:27 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Marcus Boerger
3e621fac94 make phpinfo() depend on executed sapi 2003-03-18 20:52:52 +00:00
Marcus Boerger
63739c7db8 give sapi modules the possibility to overwrite default ini settings 2003-03-18 15:53:33 +00:00
Rasmus Lerdorf
d08a0e99c8 An input filter might not simply strip stuff, it might also turn things
into entities or use some other mechanism which causes the filtered data
to be longer than the original data.  Ergo, pass in the address of the
buffer instead so the filter is free to reallocate it.
2003-02-20 22:21:49 +00:00
Rasmus Lerdorf
7429c2dc3f Input Filter support. See README.input_filter for details.
@- Input Filter support added. See  README.input_filter. (Rasmus)
2003-02-19 19:41:09 +00:00
foobar
8e3f23e3c0 ws fixes + missing $Id$ tags, headers added 2003-02-19 08:40:19 +00:00
Sascha Schumann
294e776d95 add sapi_get_target_uid/_gid for obtaining information about the
non-privileged user the web server is running as.  this is useful
for creating shared memory segments which need to be accessed by
the child processes/threads.
2003-01-21 11:03:58 +00:00
Sascha Schumann
6f4333c7ae scrap STANDARD_SAPI_MODULE_PROPERTIES; it is causing more harm than good 2003-01-15 21:13:01 +00:00
Sascha Schumann
4668b7130b whitespace 2003-01-15 11:22:04 +00:00
Derick Rethans
b9e54cb693 - Fixed bug #21169: Compile Failure, and lots of warnings on UnixWare 2003-01-02 18:01:10 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Sascha Schumann
2b95b3c83b add a "force HTTP/1.0 response" facility to the SAPI layer
this is necessary, when you want to take over control of a connection
and the web server is doing stupid things by default (like enabling
chunked transfer encoding for no reason).
2002-12-01 03:28:21 +00:00
foobar
dd53efc196 - Made the STANDARD_SAPI_MODULE_PROPERTIES be what it says it is. 2002-11-26 05:57:06 +00:00
Sascha Schumann
09f463ddae Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs. 2002-11-26 05:15:55 +00:00
Sebastian Bergmann
51e4dbaba0 Fix ZTS build. 2002-11-18 06:04:06 +00:00
George Schlossnagle
99c7ddc3a8 added support functions for the apache_hooks SAPI 2002-11-18 00:59:23 +00:00
Marcus Boerger
cecb9dfc79 Implemented -n switch to skip parsing ini at startup as suggested by Wez.
#The switch 'n' was planned to be used for beautifying....delete n to make
#clear these functions do not have a switch yet.
2002-11-12 20:56:47 +00:00
Hartmut Holzgraefe
be5e379ec6 HTTP_RAW_POST_DATA BC fixes
# hopefully all done, commiting anyway to continue work on my home box
php://input stream fixes (POST data handerl mangles data, CLI crashbug)
2002-11-12 18:29:11 +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
Rui Hirokawa
fbbeaec630 fixed: output encoding translation by mb_output_handler() in ext/mbstring was not usable when Content-Type is set by header(). 2002-07-27 13:58:16 +00:00
Sascha Schumann
9c876ea01a Add sapi_header_op interface which supersedes the sapi_add_header and _ex
calls.

Revert the change to the sapi_add_header_ex interface.

Fix various bugs:

1.  header("HTTP/1.0 306 foo");
    header("Location: absolute-uri");

    did not work in combination with several SAPI modules, because
    http_status_line was never properly reset.  And thus, all SAPI
    modules which looked at http_status_line ignored the changed
    http_response_code.

2.  The CGI SAPI did not send out the HTTP status line at all, if
    http_status_line had not been set explicitly by calling
    header("HTTP/1.0 200 foo");
2002-07-03 10:42:31 +00:00
Derick Rethans
6869cb3f5a - Added a new parameter to the header() function which overrides the HTTP
response code.
@- Added a new parameter to the header() function which overrides the HTTP
@  response code. (Derick)
2002-06-21 09:31:21 +00:00
Zeev Suraski
5af649efbd Revert to the old php_ini.c, and reimplement the binary-path searching.
Should now also work under UNIX (CLI/CGI)
2002-05-11 03:41:17 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Edin Kadribasic
1788410a56 Added argc and argv in request_info needed for the new cli sapi.
Modified registering $argc and $argv to support cli sapi.
2002-01-06 13:58:05 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
foobar
8d8e26577d Cleanup. 2001-09-07 00:58:23 +00:00
Daniel Beulshausen
0dab84d065 fix SAPI_POST_* exports 2001-08-15 18:01:48 +00:00
Zeev Suraski
2cf25894a8 improve typedef definition 2001-08-14 22:57:09 +00:00
Sascha Schumann
8aef193056 more tsrm cleanup 2001-08-05 15:29:47 +00:00
Zeev Suraski
bc42c37513 More TSRMLS_FETCH work. Got it under 400 now. 2001-07-31 06:28:05 +00:00
Zeev Suraski
d76cf1da18 More TSRMLS_FETCH work 2001-07-31 04:53:54 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Stig Bakken
0b2641efa6 @Added -C command-line option to avoid chdir to the script's directory (Stig) 2001-04-16 23:20:47 +00:00
Zeev Suraski
d3572f74bb These functions are not necessary - that's what sapi_register_post_entry()
and sapi_unregister_post_entry() are for...

Also, please maintain K&R code layout, it's very messy to have different
styles intermixed in the same codebase, and especially in the same files!
2001-03-18 02:32:04 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Zeev Suraski
60776dbeeb Fix Apache module and remove excess elements from the SAPI structure 2001-01-03 11:56:00 +00:00
Zeev Suraski
bd0ac7fe14 Many patches. I hope I remember them all:
- Make sapi_module available to external modules (PHPAPI)
- Make the php.ini path reported in phpinfo() always point to
  real full path of the php.ini file
- Optimized the ISAPI module not to read unnecessary server
  variables and read necessary variables at most once.
2001-01-02 22:49:31 +00:00
Sascha Schumann
dcd971e6bf A field of mines
Submitted by: jon@csh.rit.edu
2000-11-28 06:54:16 +00:00
Sascha Schumann
3b195720e0 Add a note about what a missing const specifier does mean in the context
of the request_info structure.
2000-11-27 13:33:33 +00:00
Zeev Suraski
0f7f5c2c0e - Import Jade Nicoletti's transparent gzip encoding support as an output
handler.  Works quite nicely!
- Fix buglets in output buffering
- Add output_handler INI directive
2000-11-13 18:54:37 +00:00
Daniel Beulshausen
87d8e44c26 win32 sapi symbol export fixes 2000-11-07 21:13:26 +00:00
Zeev Suraski
50e0d9d34b cookie_data may also be modified... 2000-11-07 18:12:06 +00:00
Sascha Schumann
43ff395b65 Const'ify part of sapi_request_info.
query_string, post_data, path_translated, request_uri, auth_user,
auth_password and argv0 are modified, so they cannot become const.
2000-11-02 15:47:02 +00:00
Sascha Schumann
2b060b3bf3 Add sapi_add_header_ex, which lets you specify whether you want
to add or replace a header.
2000-10-26 18:18:21 +00:00
Rasmus Lerdorf
bccdaff6d1 Move server_filter to an extension-specific global 2000-10-23 00:52:11 +00:00
Rasmus Lerdorf
32b10882e5 Need a global server filter for the Apache 2.0 module 2000-10-22 19:50:05 +00:00
Hartmut Holzgraefe
545ae277bc post handler registration done right
(never use emalloc in an extension MINIT function)
2000-10-13 12:13:35 +00:00
Hartmut Holzgraefe
22e48a814a @ - POST handler for Adobe FDF format (Hartmut)
the FDF handler is now working and totaly living
in the fdf extension, no more special code in
main is needed
2000-10-11 22:44:15 +00:00
Zeev Suraski
b7ecaacd07 More security-related (control) patches:
- Avoid displaying errors during startup, unless display_startup_errors is enabled.
- Implemented post_size_max limit.  Defaults to 8MB.
- Implemented file_uploads on/off directive (defaults to on).
2000-09-09 15:02:15 +00:00
Zeev Suraski
75086e3088 - Implemented is_upload_file() 2000-09-08 21:56:47 +00:00
Zeev Suraski
91c808ecc4 Restore the headers_only test to the centralized SAPI startup. If necessary, it can
be overriden in the activate() callback.
2000-09-08 14:43:57 +00:00
Sascha Schumann
320105bcd8 Use size_t as parameter type in the getenv member of struct sapi_module 2000-08-20 14:20:21 +00:00
Sascha Schumann
16017f6d78 Change header protection macros to conform to standard.
Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment"

  All identifiers that begin with an underscore and either an uppercase
  letter or another underscore are always reserved for any use by the
  implementation.
2000-07-02 23:46:51 +00:00
Andrei Zmievski
4010b422dd Separate plain name returned by php_sapi_module() and pretty name
used for output.
2000-06-26 18:05:55 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Zeev Suraski
3220bb570e - Fix an invalid trick (it was valid when header() was using
zend_get_parameters(), but it became invalid when someone switched it
  to zend_get_parameters_ex(), and I decided to remove it anyway).
- Remove a redundant function call
2000-04-28 13:03:13 +00:00
Zeev Suraski
53586378b0 @- Fix a problem when dealing with large POST blocks in CGI mode 2000-04-01 01:11:39 +00:00
Rasmus Lerdorf
c32e09f791 As it turns out, there are some browsers that can't handle default
charsets.  I think forcing this on is going to cause us a lot of headache,
so turn it off by default.
@ Don't default to iso-8859-1 since this confuses some browsers
2000-03-20 08:19:51 +00:00
Thies C. Arntzen
245428b241 fix some protos 2000-03-19 10:56:40 +00:00
Zeev Suraski
a508bec819 - From CODING_STANDARDS:
[6] NEVER USE strncat().  If you're absolutely sure you know what you're doing,
      check its man page again, and only then, consider using it, and even then,
      try avoiding it.
  strncat() is your enemy!
- Fix several SAPI services, get rid of the default_content_type (it's always
  composed of the mime type and charset now).
- Win32 works again
2000-02-26 05:03:41 +00:00