Weilin Du
2918caee20
ext/*: Remove break after return ( #21485 )
2026-03-23 20:30:13 +01:00
Giovanni Giacobbi
103e35df7d
ext/session: code refactoring - improve readability and consistency
2026-03-19 10:48:05 +00:00
Giovanni Giacobbi
d63fb997e2
ext/session: code cleanup - use single empty line except for sections
2026-03-19 10:48:05 +00:00
Giovanni Giacobbi
adba504ea8
ext/session: code cleanup - space after control flow keywords
2026-03-19 10:48:05 +00:00
Giovanni Giacobbi
3b20ccda19
ext/session: code cleanup - don't use tabs for alignments
2026-03-19 10:48:05 +00:00
Giovanni Giacobbi
a6802737b3
ext/session: code cleanup - use consistent pointer declarations
2026-03-19 10:48:05 +00:00
Giovanni Giacobbi
7b16f81651
ext/session: code cleanup - use tab for indent
2026-03-19 10:48:05 +00:00
ndossche
64092352a4
Merge branch 'PHP-8.5'
...
* PHP-8.5:
Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
2026-03-10 20:29:14 +01:00
ndossche
3b8aac8dad
Merge branch 'PHP-8.4' into PHP-8.5
...
* PHP-8.4:
Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
2026-03-10 20:29:08 +01:00
ndossche
3073948885
Revert "ext/session: Fix memory leak due to multiple exception happening during session abort"
...
This reverts commit 0acde11945 .
The patch is incorrect as described in GH-21200 in the post-merge
comments.
2026-03-10 20:28:47 +01:00
Gina Peter Banyard
f2d96c84f0
Merge branch 'PHP-8.5'
...
* PHP-8.5:
ext/session: Fix memory leak due to multiple exception happening during session abort
2026-03-07 13:30:28 +00:00
Gina Peter Banyard
10e02b0a4a
Merge branch 'PHP-8.4' into PHP-8.5
...
* PHP-8.4:
ext/session: Fix memory leak due to multiple exception happening during session abort
2026-03-07 13:30:15 +00:00
Gina Peter Banyard
0acde11945
ext/session: Fix memory leak due to multiple exception happening during session abort
...
Closes GH-21200
Co-authored-by: arshidkv12 <arshidkv12@gmail.com >
2026-03-07 13:28:42 +00:00
Alexandre Daubois
11a95749b1
Convert more zend_parse_parameters_none() to fast ZPP ( #21330 )
2026-03-04 14:07:46 +01:00
Gina Peter Banyard
99bf26be0b
ext/session: add mod_user_uses_object_methods_as_handlers global
...
This solves the use case of knowing if the session handlers are methods of an object or individual handlers without relying on the now removed mod_user_names global.
2026-02-16 14:27:45 +00:00
Gina Peter Banyard
dbb28641e2
ext/session: pack boolean globals
...
This reduces the size of the global struct from 448 bytes to 432 bytes
2026-02-16 14:27:45 +00:00
Gina Peter Banyard
86b4921157
ext/session: only return false when could not encode session at all ( #21181 )
...
* ext/session: only return false when could not encode session at all
This also fixes bug 71162
2026-02-16 11:44:15 +00:00
Shivam Mathur
66d908f112
ext/session: fix PS_FUNCS() macro expansion ( #21196 )
...
Added the missing trailing `;` after `PS_CREATE_SID_FUNC(x)` so `PS_FUNCS(x)` expands to valid prototypes.
2026-02-11 14:54:45 +00:00
Gina Peter Banyard
4b01cd1bf3
ext/session/mod_mm: implement VALIDATE_SID handler ( #21178 )
...
Rather than "manually" doing it in the READ handler.
At the same time, get rid of various inconsistent legacy handler macro definitions, thus mandating all modules to implement the create and validate SID handlers.
The only handler that remains optional is the update timestamp one.
2026-02-10 12:17:47 +00:00
Gina Peter Banyard
e1b2f1f5cb
ext/session: move variable initialization out of if condition
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
8af056206e
ext/session: add const qualifiers
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
cc304d14ab
ext/session: refactor bin_to_readable()
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
ca08e5f7fe
ext/session: reduce scope of variables
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
9026396c26
ext/session: simplify php_session_reset()
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
888b393d2f
ext/session: fix typo in comment
2026-02-09 12:11:04 +00:00
Gina Peter Banyard
71096cd873
ext/session: use zend_strings for open handler
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
ba17532fed
ext/session: use known 1 char zend_string to update boolean INI setting
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
f6088f574c
ext/session: remove session_adapt_url() function
...
This is unused and only exist for the deprecated (and dangerous) GET/POST session ID feature
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
1041a47ed3
ext/standard: throw ValueError if argument contains null byte in session_module_name()
...
And fix error message to use 'must not' rather than 'cannot'
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
a0de1ace41
ext/session: refactor session_write_close()
...
By making the underlying function return a bool and not do duplicate checks
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
8926dc0140
ext/session: refactor session_reset()
...
By making the underlying function return a bool and not do duplicate checks
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
a9496bdc22
ext/session: refactor session_abort()
...
By making the underlying function return a bool and not do duplicate checks
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
a8bdfa665b
ext/session: remove mod_user_class_name global
2026-02-09 10:49:59 +00:00
Gina Peter Banyard
31b0055557
ext/session: add const qualifiers
2026-02-06 01:18:46 +00:00
Gina Peter Banyard
3a142e77ee
ext/session: remove unused progress parameter in early_find_sid_in()
2026-02-06 01:18:46 +00:00
Gina Peter Banyard
b657deffc7
ext/session: remove unused macros
...
This deletes the PS_ADD_VARL(), PS_ADD_VAR(), and PS_DEL_VARL() macros.
2026-02-06 01:18:46 +00:00
Gina Peter Banyard
a2c6e6f66a
ext/session: remove PS_ENCODE_VARS
...
By moving the declaration of the variables inside PS_ENCODE_LOOP() macro.
2026-02-06 01:18:46 +00:00
Gina Peter Banyard
b56f068756
ext/session: use RETURN_BOOL() when possible
2026-02-05 13:01:38 +00:00
Gina Peter Banyard
713fbeda97
ext/session: no need to free a known zend_string
2026-02-05 13:01:38 +00:00
Gina Peter Banyard
f4b38fc9c6
ext/session: use true/false rather than 1/0
2026-02-05 13:01:38 +00:00
Gina Peter Banyard
b68122e15b
ext/session: use bool type instead of int
2026-02-05 13:01:38 +00:00
Tim Düsterhus
a15ba7672c
zend_ini: Make ZEND_INI_GET_ADDR() return a void* pointer ( #21119 )
...
* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer
Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.
* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`
* UPGRADING.INTERNALS
2026-02-04 11:11:11 +01:00
Daniel Scherzer
22c618ee00
ext/session: use STANDARD_MODULE_HEADER for module entry ( #21066 )
...
Now that the extension has no dependencies (#21060 ), no need to use
`STANDARD_MODULE_HEADER_EX`.
2026-01-28 20:46:11 -08:00
Peter Kokot
65fd4d83bc
Remove ext/spl dependency from ext/session ( #21060 )
...
This is a follow-up of 668606816f
(GH-21001).
The SPL extension is no longer needed to be listed among dependencies.
The https://bugs.php.net/53141 is tested in
ext/session/tests/bug53141.phpt.
Additionally:
- Added missing inclusion guards to Zend/zend_autoload.h
2026-01-28 16:25:40 +00:00
Arnaud Le Blanc
65b4073922
Include the actual stub name in generated arginfo headers ( #20993 )
2026-01-21 20:57:00 +01:00
Niels Dossche
341d2d1bdc
Merge branch 'PHP-8.5'
...
* PHP-8.5:
Fix GH-20771: Assertion failure when getUnicodeHost() returns empty string
ext/session/mod_mm.c: add a few missing ZSTR macros
2025-12-23 23:18:03 +01:00
Michael Orlitzky
0eb6a4d32f
ext/session/mod_mm.c: add a few missing ZSTR macros
...
In eaee504c the session's save_path global was changed to a
zend_string pointer, but there are a few direct char-pointer accesses
in ext/session/mod_mm.c that slipped through the cracks. GCC-15
notices them and fails to build due to the incompatible pointer types.
Three ZSTR_* wrappers are all that is needed.
Gentoo-Bug: https://bugs.gentoo.org/967862
Closes GH-20772.
2025-12-23 23:17:07 +01:00
Peter Kokot
4743dd673e
ext/session: Remove unused source files and headers on Windows ( #20463 )
...
These are only useful on Unix-like environments when libmm is enabled
via configuration option.
2025-11-12 19:33:38 +01:00
Tim Düsterhus
985d681501
tree-wide: Replace zval_is_true() by zend_is_true() ( #20065 )
...
* tree-wide: Replace `zval_is_true()` by `zend_is_true()`
The former is a direct alias of the latter which is much more often used.
* zend_operators: Remove `zval_is_true()`
2025-10-07 20:44:32 +02:00
Tim Düsterhus
9659d7f1ed
session: Use true / false instead of 1 / 0 for bool parameters
...
Changes done with Coccinelle:
@r1@
identifier F;
identifier p;
typedef bool;
parameter list [n1] PL1;
parameter list [n2] PL2;
@@
F(PL1, bool p, PL2) {
...
}
@r2@
identifier r1.F;
expression list [r1.n1] EL1;
expression list [r1.n2] EL2;
@@
F(EL1,
(
- 1
+ true
|
- 0
+ false
)
, EL2)
2025-09-24 18:51:40 +02:00