Commit Graph

976 Commits

Author SHA1 Message Date
Sara Golemon
2d9885c8cb Fix handling of session user module custom handlers.
According to the documentation, returning TRUE from
user based session handlers should indicate success,
while returning FALSE should indicate failure.

The existing logic relied on casting the return value
to an integer and returning that from the function.
However, the internal handlers use SUCCESS/FAILURE
where SUCCESS == 0, and FAILURE == -1, so the following
behavior map occurs:

  return false; => return 0; => return SUCCESS
  return true; => return 1; => return <undefined>

Since the session API checks against FAILURE,
both boolean responses wind up appearing like "not FAILURE".

This diff reasserts boolean responses to behave as
documented and introduces some special handling
for integer responses of 0 and -1 so that code can be
written for older and newer versions of PHP.
2014-07-06 09:40:35 -07:00
Andrea Faulds
2b5d25d1fc Merge branch 'httponly-cookies' of https://github.com/mj/php-src 2014-06-12 10:03:14 +01:00
Martin Jansen
068bf645e1 Remove usage of pointless COOKIE_SET_COOKIE constant. 2014-05-18 10:45:31 +02:00
Ferenc Kovacs
0cd679fb17 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests (they might fail from time to time because of session GC)
  Fix author name on the #63228 patch.
2014-05-07 00:39:57 +02:00
Ferenc Kovacs
d2f283884f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed tests (they might fail from time to time because of session GC)
  Fix author name on the #63228 patch.
2014-05-07 00:38:57 +02:00
Ferenc Kovacs
579898e338 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed tests (they might fail from time to time because of session GC)
  Fix author name on the #63228 patch.
2014-05-07 00:38:32 +02:00
Dmitry Stogov
f880013c4d Fixed tests (they might fail from time to time because of session GC) 2014-05-07 00:37:56 +02:00
Martin Jansen
71ad601dee Fix typo 2014-05-06 22:08:52 +02:00
Martin Jansen
c5f9a231d5 Streamlining of cookie handling in ext/session and setcookie
Up until now the session cookie used "HttpOnly" to indicate cookies
only available through HTTP while setcookie() used "httponly".  The
relevant RFC 6265 claims that case does not matter for this token,
but only explicitely mentions "HttpOnly".  Thus this seems like a
logical choice when streamlining the code.

Also the setcookie implementation now uses the same string constants
as the session extension for other tokens like Max-Age or the domain
attribute.

This change poses a slight risk of backwards incompatibility in places
where people deliberately ignore chapter 5.2.5 of RFC 6265 and perform
case-sensitive checks for the HttpOnly attribute.
2014-05-06 22:00:59 +02:00
Martin Jansen
c0f4e270a8 This test requires the hash extension. 2014-05-06 21:34:10 +02:00
Anatol Belski
634e6b61d9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix windows build
2014-04-14 23:34:50 +02:00
Anatol Belski
793f67e852 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix windows build
2014-04-14 23:30:14 +02:00
Anatol Belski
24b72e7a27 fix windows build 2014-04-14 23:29:38 +02:00
Stanislav Malyshev
99b01fb3d7 ws fix 2014-04-14 13:35:59 -07:00
Stanislav Malyshev
8bc82718ae Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix #66942: openssl_seal() memory leak
  ws fix

Conflicts:
	ext/openssl/openssl.c
2014-04-14 13:35:24 -07:00
Stanislav Malyshev
56f9727305 ws fix 2014-04-14 13:16:53 -07:00
Stanislav Malyshev
41569b1029 Fix bug #66171: better handling of symlinks 2014-04-14 10:51:31 -07:00
Stanislav Malyshev
7f43aeb167 Fix bug #66171: better handling of symlinks 2014-04-14 10:46:45 -07:00
Stanislav Malyshev
40a9316dff Fix bug #66171: better handling of symlinks 2014-04-14 10:44:53 -07:00
Yasuo Ohgaki
973f379efc Remove unneeded test 2014-03-13 06:54:52 +09:00
Yasuo Ohgaki
6f0ad9ea12 Revert "Implement Bug #54649 Create session_serializer_name()"
This reverts commit 678ec30655.

Conflicts:
	ext/session/tests/session_serializer_name_basic.phpt
2014-03-13 06:32:49 +09:00
Yasuo Ohgaki
7dec5789fe Revert "Implemented Request #11100 (session_gc() function)."
This reverts commit 54a42f0d0c.

Conflicts:
	ext/session/tests/session_gc_basic.phpt
2014-03-13 06:30:32 +09:00
Anatol Belski
1cb4398ac1 primitive test fixes 2014-02-28 09:43:57 +01:00
Yasuo Ohgaki
53e3023566 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug data->fd not set to -1 for open_basedir failure.
2014-01-30 14:16:47 +09:00
Yasuo Ohgaki
b1c0614ecc Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug data->fd not set to -1 for open_basedir failure.
2014-01-30 14:16:05 +09:00
Yasuo Ohgaki
f5e097d1ed Fixed bug data->fd not set to -1 for open_basedir failure. 2014-01-30 14:15:29 +09:00
Anatol Belski
698b04270e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  refixed that test for 5.5+
  5.5.10 next
2014-01-22 23:30:52 +01:00
Anatol Belski
c0fcd3d6b0 refixed that test for 5.5+ 2014-01-22 23:30:14 +01:00
Anatol Belski
f8e9f84a97 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed test
2014-01-22 15:40:58 +01:00
Anatol Belski
0436b85d9f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed test
2014-01-22 15:40:19 +01:00
Anatol Belski
0eff7176de fixed test 2014-01-22 15:39:49 +01:00
Anatol Belski
ca27c86110 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix zts
2014-01-22 12:05:06 +01:00
Anatol Belski
6d1d8ec330 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix zts
2014-01-22 12:04:25 +01:00
Anatol Belski
34792280bc fix zts 2014-01-22 12:03:54 +01:00
Yasuo Ohgaki
3cc6c6c587 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed previous commit may delete unwanted cookies.
  Re-fixed bug #66469
2014-01-22 19:23:17 +09:00
Yasuo Ohgaki
fa224b1c58 Fixed previous commit may delete unwanted cookies. 2014-01-22 19:23:01 +09:00
Yasuo Ohgaki
58f94345a7 Fixed previous commit may delete unwanted cookies. Sync tests from upper branches. 2014-01-22 19:21:25 +09:00
Yasuo Ohgaki
26a2bed185 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Re-fixed bug #66469
2014-01-22 13:47:55 +09:00
Yasuo Ohgaki
383423a1ee Re-fixed bug #66469 2014-01-22 13:46:59 +09:00
Yasuo Ohgaki
a27e51fd4e Re-fixed bug #66469 2014-01-22 13:40:58 +09:00
Anatol Belski
8b703e9ee0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  forked the test for bug #66481
2014-01-17 03:32:06 +01:00
Anatol Belski
14e371e7d4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  forked the test for bug #66481
2014-01-17 03:31:38 +01:00
Anatol Belski
a218a8b917 forked the test for bug #66481 2014-01-17 03:30:42 +01:00
Xinchen Hui
bfcdd67865 Merge branch 'PHP-5.5' into PHP-5.6 2014-01-16 14:42:04 +08:00
Xinchen Hui
9799816e0c Merge branch 'PHP-5.4' into PHP-5.5 2014-01-16 14:41:52 +08:00
Xinchen Hui
b777248ded Re-fixed Bug #66481 (Calls to session_name() segfault when session.name is null) 2014-01-16 14:41:12 +08:00
Xinchen Hui
271053ad47 Revert "Bug #66481 Segfaults on session_name()"
This reverts commit 5662ffb295.
2014-01-16 14:38:35 +08:00
Yasuo Ohgaki
518327f7e3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #66481 Segfaults on session_name()
2014-01-16 11:35:11 +09:00
Yasuo Ohgaki
744f38c2d6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Bug #66481 Segfaults on session_name()
2014-01-16 11:34:31 +09:00
Conor McDermottroe
5662ffb295 Bug #66481 Segfaults on session_name()
If the previous value of session.name was NULL then any call to
session_name($string) would result in a segmentation fault.

This changes the behaviour to set the value of session.name to
"PHPSESSID" if a blank value is given in php.ini or via -d on the
command line. There is already protection against setting it to NULL via
session_name() or ini_set().
2014-01-16 11:33:10 +09:00