Commit Graph

162 Commits

Author SHA1 Message Date
Kalle Sommer Nielsen
9f782a73e8 Changed http_response_code() to be able to set a response code 2011-07-12 03:56:32 +00:00
Scott MacVicar
b966897a0d Turns out that more than 1% of users clocks are more than a year out of date, this causes cookies to never get deleted since the date is in the future.
I can only guess its due to batteries on the motherboard being dead.
2011-05-10 19:09:24 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Kalle Sommer Nielsen
1fed0e5a84 Kill some more constness warnings in com_dotnet/phar/standard 2010-11-19 16:03:00 +00:00
Ilia Alshanetsky
57ff563262 Make http_response_code() return FALSE where data is not available (Ex. cli sapi) 2010-08-10 00:19:51 +00:00
Kalle Sommer Nielsen
4281addcb7 Implemented FR #52555 (Ability to get HTTP response code)
- Patch by Paul Dragoonis
2010-08-09 13:10:32 +00:00
Michael Wallner
11d24c1593 * implement new output API, fixing some bugs and implementing some feature
requests--let's see what I can dig out of the bugtracker for NEWS--
  and while crossing the road:
   * implemented new zlib API
   * fixed up ext/tidy (what was "s&" in zend_parse_parameters() supposed to do?)

Thanks to Jani and Felipe for pioneering.
2010-05-31 10:29:43 +00:00
Kalle Sommer Nielsen
dd8e59da8f Removed safe_mode
* Removed ini options, safe_mode*
 * Removed --enable-safe-mode --with-exec-dir configure options on Unix
 * Updated extensions, SAPI's and core
 * php_get_current_user() is now declared in main.c, thrus no need to include safe_mode.h anymore
2010-04-26 23:53:30 +00:00
Jani Taskinen
af49e58f51 - Reverted r296062 and r296065 2010-03-12 10:28:59 +00:00
Jani Taskinen
06f072cb5e MFH: Improved / fixed output buffering (Michael Wallner) 2010-03-11 10:24:29 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Ilia Alshanetsky
06a2acc527 Fixed bug #45141 (setcookie will output expires years of >4 digits). 2009-07-29 13:44:16 +00:00
Matt Wilmas
1fa3b21c15 MFH: Fixed error message grammar:
- "cannot" instead of "can not" (meaning "also can")
 - "than" instead of "then" (Hint: "then" should hardly be needed;
     you're not telling the order in which to do something)

... plus removed a couple ending. dots
2009-06-06 02:40:49 +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
Arnaud Le Blanc
d69dfa4b9f MFH: initialize optional vars 2008-10-21 22:08:38 +00:00
Antony Dovgal
d7d94aab53 fix typo 2008-06-10 08:14:52 +00:00
Felipe Pena
84a8bb038a MFH: New way for check void parameters 2008-03-10 22:15:36 +00:00
Rasmus Lerdorf
92cd32246b No point in echoeing the raw value back here in the error message 2008-02-22 05:13:20 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Ilia Alshanetsky
58c167168d Revert previous commit that caused a buffer overflow (Bug #40634) 2007-02-26 02:12:36 +00:00
Marcus Boerger
50ea26760d - Avoid sprintf, even when checked copy'n'paste or changes lead to errors 2007-02-24 02:17:47 +00:00
Ilia Alshanetsky
094a5717b1 Eliminate strcat() and strcpy() 2007-01-25 00:26:51 +00:00
Ilia Alshanetsky
eb6b99d7df strcat() -> strlcat() 2007-01-24 00:45:54 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Antony Dovgal
0ebfbfe791 MFH: initialize optional vars 2006-10-16 19:27:57 +00:00
Ilia Alshanetsky
e5fe441cbd Added support for httpOnly flag for session extension and cookie setting
functions.

# Original patch by Scott MacVicar
2006-08-10 13:50:56 +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
Antony Dovgal
38e4fb09e0 fix tsrm build 2005-07-08 18:16:46 +00:00
Ilia Alshanetsky
bf020f87e1 Missing bit of the previous patch. 2005-07-08 16:17:04 +00:00
Ilia Alshanetsky
046635075b Fixed compiler warning. 2005-07-08 16:06:05 +00:00
Antony Dovgal
eb7dc34bfb make use of T token 2005-07-08 12:39:51 +00:00
Antony Dovgal
592a0835fa fix #33597 (setcookie() "expires" date format doesn't comply with RFC) 2005-07-08 12:30:24 +00:00
Antony Dovgal
5eeb444b8b remove duplicated include 2005-01-07 20:55:46 +00:00
Anantha Kesari H Y
293ab565b5 removing unwanted inclusion of socket header file 2004-09-25 15:33:57 +00:00
Ilia Alshanetsky
8eacea8b48 Fixed proto of headers_list(). 2004-08-23 16:58:11 +00:00
Brian France
d5b6608da5 Added checks for invalid characters in a cookie name or cookie data from setrawcookie 2004-02-11 19:00:42 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Andi Gutmans
fea31127ec - Fix Windows build 2003-11-20 09:14:51 +00:00
Sara Golemon
0101c27823 New function: headers_list(). Ennumerate headers sent to SAPI engine 2003-11-19 21:10:33 +00:00
Brian France
d50e0bf4de Added a parameter to php_setcookie to toggle URL encoding of the cookie data
Added the function setrawcookie that turns off URL encoding of the cookie data
Changed setcookie to turn on the URL encoding of the cookie data
2003-08-20 20:51:10 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sebastian Bergmann
5ca078779a Eliminate some TSRMLS_FETCH() calls. Tested with Win32 build of SAPI/CGI and SAPI/CLI on Win32. 2003-03-25 08:07:13 +00:00
David Hill
5c90216d2c 64-bit correction to variables passed to zend_parse_parameters
@64-bit correction to variables passed to zend_parse_parameters (Dave)
2003-03-06 23:07:28 +00:00
Sebastian Bergmann
b506f5c8f8 Bump year. 2002-12-31 16:08:15 +00:00
Ilia Alshanetsky
b801568bbb Fixed a crash in headers_sent(), that occures if
php_get_output_start_filename() returns NULL.
2002-11-07 00:23:58 +00:00
Hartmut Holzgraefe
4e6635742d it should not only work for the failure case
but also not fail (segfault) on the working case
2002-09-17 13:54:40 +00:00
Hartmut Holzgraefe
0c7d9c3742 headers_sent() may now return information about where output started
using the optional $file and $line reference parameters
2002-09-17 12:37:26 +00:00
Anantha Kesari H Y
8b8f1e0590 NetWare related additions/modifications 2002-09-05 14:25:07 +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
Marcus Boerger
9c8ba935d6 Improved handling of output buffers (see news)\n#No trim for the string parameter... 2002-08-09 22:29:58 +00:00
Marcus Boerger
783fddeb0f possible memoryleak 2002-08-09 20:53:37 +00:00
Derick Rethans
728f2de442 Unify error messages 2002-07-08 12:52:22 +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
Cliff Woolley
34d471d22e Only the last cookie was getting set. (You can have
more than one Set-Cookie: header, as indicated by
http://wp.netscape.com/newsref/std/cookie_spec.html.)

PR: 16626
Submitted by: regina@hitel.net
2002-05-17 07:10:19 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Frank M. Kromann
b4d9b70c6e Make php_setcookie available from shared extensions 2001-12-03 05:10:10 +00:00
Andrei Zmievski
030e873758 convert to use new parameter parsing API. 2001-10-19 19:48:35 +00:00
Egon Schmid
1f852425d1 Fixed other protos. 2001-10-19 19:21:28 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Rasmus Lerdorf
4d11d90880 Track down a few more functions that don't check for 0 args and use
faster mechanism
2001-08-13 07:55:39 +00:00
Zeev Suraski
c0404f4631 Whitespace 2001-08-11 17:03:37 +00:00
Zeev Suraski
bc42c37513 More TSRMLS_FETCH work. Got it under 400 now. 2001-07-31 06:28:05 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Rasmus Lerdorf
cc44119bf6 Left-over outdated comment 2001-07-21 15:51:40 +00:00
Zeev Suraski
20d53346ce Remove redundant code 2001-07-21 12:43:23 +00:00
Zeev Suraski
38e5a2077d Clarify and optimize 2001-07-21 01:15:18 +00:00
Rasmus Lerdorf
bf513871bc Fix more crashes related to this switch to z_value 2001-07-21 00:14:14 +00:00
Stanislav Malyshev
5ad3d2828f Fix potential crash 2001-06-14 15:36:10 +00:00
Zeev Suraski
1093ed17fb Clean-up
Remove a lot of 100% redundent code
2001-06-13 17:04:36 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
9b2a1110a6 Allow users to specify whether they want to replace existing header fields. 2000-10-27 09:43:06 +00:00
Sascha Schumann
102c6ce4b8 Move main.h to php_main.h. 2000-06-05 23:24:42 +00:00
Andi Gutmans
3701bc4207 - ARG_COUNT(ht) -> ZEND_NUM_ARGS() mega patch 2000-06-05 19:47:54 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Hartmut Holzgraefe
e5a2f0f95c proto-takeover from php3 2000-05-17 19:40:10 +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
Stig Bakken
99e0b36321 @Cleaned up extension namespace (Stig)
Cleaned up extension namespace, and changed ext/standard into one single
extension.
2000-03-06 20:37:11 +00:00
Zeev Suraski
86fa2aade2 the pipe is breaking all the time 2000-02-19 23:41:32 +00:00
Zeev Suraski
6d0ab6166c SAPIfication, Episode VI: Return of the SAPI
Remove mostly all references to APACHE and CGI_BINARY from the code.

- Apache include files are no longer included by any PHP code, except for the Apache SAPI module.
- No server specific code is in any of the base PHP code.

Still left to be done:
- Eliminate any references to APACHE from the few remaining modules.
- Move request_info.c's logic to SAPI
- Modify the regex function names, and globals, so that we can always
  include them, without having to fear any interference with Apache;
  Always use the bundled regex library
2000-02-10 19:41:21 +00:00
Thies C. Arntzen
59e466d54c fix for #3413
@- Fixed possible buffer-overflow in setcookie(). (Thies)
2000-02-06 14:36:27 +00:00
Zeev Suraski
fc678100cd post.c really had nothing to do with POST anymore, and it belongs to the top level directory 2000-01-28 13:31:12 +00:00
Zeev Suraski
972631be71 - Added flush() support to SAPI
- Got rid of the old flush() implemenetation in favour of the new one
- Added implicit_flush() support to the output buffering layer.
@- Added implicit_flush() to control whether flush() should be called
@  implicitly after any output (Zeev)
2000-01-13 17:37:25 +00:00
Sascha Schumann
43ae2bffbb Happy Y2K patch! Happy new year (or the new millennium, depending on whether
you start counting at 0 or 1).
2000-01-01 01:32:05 +00:00
Evan Klinger
f5d5637f72 Ex API 1999-12-20 02:09:58 +00:00
Zeev Suraski
3ee4e65c95 More php3_ annihilation 1999-12-18 04:01:20 +00:00
Zeev Suraski
fb1c77bd4f - Made PHP_VERSION and PHP_OS work again
- More php3_ cleanup
@- Restored the PHP_VERSION and PHP_OS constants (Zeev)
1999-12-17 20:55:31 +00:00
Zeev Suraski
a3c6514332 More php3_ annihilation 1999-12-17 19:51:39 +00:00
Sascha Schumann
5b983c944f Clean up php3.*\.h files. The files itself are renamed, and references in all
.*\.[ch] files were changed. There is a slight chance that my script missed
a few changes, please correct them manually.
1999-12-04 19:19:57 +00:00
Zeev Suraski
3cb1eb0471 Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
1999-08-02 19:17:14 +00:00
Andrey Hristov
1b2c932cc2 More symbol work.
I've defined a few macros to help with module/request init/startup function definitions.
Basically:

PHP_MINIT_FUNCTION(module)
PHP_MSHUTDOWN_FUNCTION(module)
PHP_RINIT_FUNCTION(module)
PHP_RSHUTDOWN_FUNCTION(module)
PHP_MINFO_FUNCTION(module)

These will expand to proper function prototypes.

Now to specify these in the module entry, use:

PHP_MINIT(module)
PHP_MSHUTDOWN(module)
PHP_RINIT(module)
PHP_RSHUTDOWN(module)
PHP_MINFO(module)

I've updated all modules in ext/standard and everything from ext/apache to ext/db.
If you can, please update your module to use these macros.
1999-07-26 20:09:08 +00:00
Andrey Hristov
736f4831a5 A bunch of grunt work updating function entries and declarations. 1999-07-24 22:16:54 +00:00
Andrey Hristov
2d1b6f0801 Added headers_sent() function 1999-07-20 18:03:27 +00:00
Zeev Suraski
c5724cbd14 License update 1999-07-16 13:13:16 +00:00
Sascha Schumann
39691bed9e conv_proto *.[ch] 1999-05-16 11:19:26 +00:00