1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

690 Commits

Author SHA1 Message Date
Jakub Zelenka
5c0a6feca2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update NEWS with info about security issues
  Fix GHSA-www2-q4fc-65wf
  Fix GHSA-h96m-rvf9-jgm2
  Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref
  Fix GH-20584: Information Leak of Memory
2025-12-16 15:36:52 +01:00
Jakub Zelenka
633fb48fca Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Update NEWS with info about security issues
  Fix GHSA-www2-q4fc-65wf
  Fix GHSA-h96m-rvf9-jgm2
  Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref
  Fix GH-20584: Information Leak of Memory
2025-12-16 15:35:25 +01:00
Jakub Zelenka
e776695abf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update NEWS with info about security issues
  Fix GHSA-www2-q4fc-65wf
  Fix GHSA-h96m-rvf9-jgm2
  Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref
  Fix GH-20584: Information Leak of Memory
2025-12-16 15:34:19 +01:00
Jakub Zelenka
6e124d0df6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Update NEWS with info about security issues
  Fix GHSA-www2-q4fc-65wf
  Fix GHSA-h96m-rvf9-jgm2
  Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref
  Fix GH-20584: Information Leak of Memory
2025-12-16 15:30:54 +01:00
Jakub Zelenka
727a4ddc39 Fix GHSA-8xr5-qppj-gvwj: PDO quoting result null deref 2025-12-16 15:26:59 +01:00
Gina Peter Banyard
05eda4318d Add missing extension dependencies for tests 2025-09-11 15:10:49 +02:00
David CARLIER
9f8802c416 ext/pdo_pgsql: [RFC] Deprecate PGSQL_TRANSACTION_ constants. (#19594) 2025-09-07 19:47:20 +01:00
Arnaud Le Blanc
a4afc57f1d Deprecate driver specific PDO methods
RFC: https://wiki.php.net/rfc/deprecations_php_8_5.

Closes GH-19596
2025-09-03 08:42:33 +02:00
Arnaud Le Blanc
6f32e1c690 Deprecate driver specific PDO constants
RFC: https://wiki.php.net/rfc/deprecations_php_8_5.

Closes GH-19526
2025-08-26 09:06:19 +02:00
Gina Peter Banyard
d9000b3094 tree: replace some unnecessary uses of spprintf (#19354) 2025-08-05 17:25:47 +01:00
David Carlier
f7ca8138e7 Merge branch 'PHP-8.4' 2025-07-27 12:56:05 +01:00
David Carlier
279589c3af Merge branch 'PHP-8.3' into PHP-8.4 2025-07-27 12:55:17 +01:00
dixyes
e16df981bf ext/pdo_pgsql: Fix _pdo_pgsql_trim_message bad access
close GH-19239
2025-07-27 12:54:43 +01:00
Jakub Zelenka
a2cdff5583 Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-07-01 19:46:48 +03:00
Jakub Zelenka
545d1536d8 Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-07-01 09:34:49 -07:00
Ilija Tovilo
49d94cced0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GHSA-453j-q27h-5p8x
  Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
  Fix GHSA-3cr5-j632-f35r: Null byte in hostnames
2025-07-01 17:48:00 +02:00
Jakub Zelenka
66bd809ac9 Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-07-01 23:01:16 +09:00
Jakub Zelenka
9376aeef9f Fix GHSA-hrwm-9436-5mv3: pgsql escaping no error checks
This adds error checks for escape function is pgsql and pdo_pgsql
extensions. It prevents possibility of storing not properly escaped
data which could potentially lead to some security issues.
2025-06-23 23:02:13 +02:00
David Carlier
cce0efdff8 Revert "ext/pdo_pgsql: Delete unused constants"
This reverts commit e549ccb32e.
2025-06-06 14:45:59 +01:00
Jakub Vrána
e549ccb32e ext/pdo_pgsql: Delete unused constants
These constants were added by 6ed1819bf4 but they are not used anymore.

They are undocumented which is why I've stumbled upon this.

close GH-18358
2025-06-06 07:34:25 +01:00
David CARLIER
a5196bf3d6 ext/pdo_pgsql: updating copy from according to pgsql extension workflow. (#18175)
mainly using zend_string instead.
2025-03-28 18:24:45 +00:00
Ilija Tovilo
8f21763616 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix varying pgsql error message
2025-02-26 21:30:32 +01:00
Ilija Tovilo
8be263d2a1 Fix varying pgsql error message 2025-02-26 21:30:24 +01:00
Gina Peter Banyard
b757fa812d ext/pdo_{odbc|pgsql}: Use precomputed data_source_len (#17744)
This is already computed by PDO, no need to recompute it again inside the drivers.
2025-02-09 13:10:20 +00:00
Gina Peter Banyard
09791ed1d1 ext/pdo: Convert database_object_handle zval to zend_object* (#17629)
This saves 8 bytes on the PDO statement struct.

We change the PGSQL PDO driver API to take a zend_object* instead of a zval* at the same time.
2025-01-30 18:34:03 +00:00
Niels Dossche
6f4579af85 Introduce php_pdo_stmt_valid_db_obj_handle() (#17567) 2025-01-28 21:54:11 +01:00
Kamil Tekiela
3e1138e997 Remove disable_native_prepares 2024-11-25 22:27:43 +01:00
Gina Peter Banyard
27a1d69504 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/pdo_pgsql: Remove new PDO class constant specific to PGSQL driver
2024-11-16 16:30:55 +00:00
Gina Peter Banyard
5e360b6402 ext/pdo_pgsql: Remove new PDO class constant specific to PGSQL driver
Closes GH-16755
2024-11-16 16:30:19 +00:00
Máté Kocsis
a47d823405 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16314 "Pdo\Mysql object is uninitialized" when opening a persistent connection (#16369)
2024-11-05 08:33:11 +01:00
Máté Kocsis
a5f137821a Fix GH-16314 "Pdo\Mysql object is uninitialized" when opening a persistent connection (#16369) 2024-11-05 08:32:44 +01:00
David CARLIER
dbcc77d0c2 Fix GH-15893: Pdo\Pgsql backport fixes from GH-16124 (#16158) 2024-10-03 19:25:39 +01:00
Guillaume Outters
68537fd9f4 Fix / implement GH-15287: add a lazy fetch to Pdo\PgSql
Make Pdo\PgSql accept Pdo::setAttribute(PDO::ATTR_PREFETCH, 0) to enter libpq's single row mode.
This avoids storing the whole result set in memory before being able to call the first fetch().

close GH-15750
2024-09-29 08:33:14 +01:00
KentarouTakeda
6fb81d2360 test(pdo_pgsql): Exclude pdo implicitly required by pdo_pgsql from EXTENSIONS (#16116) 2024-09-29 08:20:29 +01:00
武田 憲太郎
7f5e96d030 ext/pdo_pgsql: Expanding COPY input from an array to an iterable
close GH-15893
2024-09-28 11:09:34 +01:00
David Carlier
f35ad560b4 GH-12940 ext/pdo_pgsql: using PQclosePrepared to free statement resources.
PQclosePrepared allows the statement's name to be reused thus allowing
cache solutions to work properly ; whereas, for now, the `DEALLOCATE
<statement>` query is used which free entirely the statement's resources.

close GH-13316
2024-09-24 12:09:56 +01:00
Christoph M. Becker
2b90acb469 Fix GH-15986: Double-free due to Pdo\Pgsql::setNoticeCallback()
We need to release the fcall info cache instead of destroying it.

Closes GH-15987.
2024-09-22 23:35:05 +02:00
David Carlier
adfd7de5c3 Merge branch 'PHP-8.3' 2024-09-12 18:19:53 +01:00
David Carlier
32358173c9 Fix GH-15729 PDO tests name conflicts.
close GH-15765
2024-09-12 18:19:20 +01:00
Christoph M. Becker
50b3a0d011 Add comments about internal headers (GH-15689)
A common convention is to name internal C header files as `*_int.h`.
Since a couple of these are actually installed, we add comments that
this is not supposed to happen, (a) to avoid installing further
internal headers, and (b) to pave the way to fix this in the next major
PHP version.

Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation
for "interface".

Another common convention is appending `_priv` or `_private`, but since
there have not been any issues regarding these headers so far, we
refrain from adding respective comments to these headers.

Anyhow, it might be a good idea to introduce some common naming
convention for such internal/private headers.
2024-09-08 16:11:25 +02:00
Christoph M. Becker
a57ce052cd Don't export php_pdo_int.h
This is, as the name and a comment in the header imply, an internal
header which is not supposed to be used by extensions other than PDO
(not even by drivers).

Since there is apparently no need to include this header in the parsers
of the drivers, we remove these includes, and no longer declare the
header to be installed.  Given that the header is only exported for a
couple of weeks[1], this is not considered to be a BC break, because
it's unlikely that external drivers have already been adjusted to use
this header, and otherwise they can still be fixed; PHP 8.4 is still in
the pre-release stage.

[1] <https://github.com/php/php-src/pull/14797>

Closes GH-15688.
2024-09-01 13:33:53 +02:00
Máté Kocsis
8d12f666ae Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
Gina Peter Bnayard
5853cdb73d Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
Gina Peter Bnayard
e7c4d54d65 Use new helper function for "cannot be empty" ValueErrors 2024-08-21 21:12:17 +01:00
Peter Kokot
693ec809b9 Autotools: Remove PDO dependency related errors (#15347)
Follow-up of GH-15344 (687eb9125a)

This removes the customized error messages in PDO extensions when PDO is
not enabled (--disable-all or --disable-pdo) in favor of the default
error done by PHP_ADD_EXTENSION_DEP.
2024-08-11 21:35:36 +02:00
Peter Kokot
80ae7f7979 Update pgsql extensions preprocessor macros help texts (#15290)
[skip ci]
2024-08-08 16:14:43 +02:00
Peter Kokot
f66feaec0f Sync HAVE_<extension> help texts (#15167)
This syncs all help texts of extension preprocessor macros to the same
style "Define to 1 if the PHP extension '<ext>' is available.".
[skip ci]
2024-08-02 01:41:47 +02:00
Peter Kokot
1ceadaed52 Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
Saki Takamachi
acd6ac3324 Fixed parent class of stub (#14990) 2024-07-17 21:38:59 +09:00
Peter Kokot
2ebef11e83 Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +02:00