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

232 Commits

Author SHA1 Message Date
Arshid
c524773a4f ext/ftp: Remove unreachable break (#21481) 2026-03-21 11:24:04 +00:00
Arshid
c995a6cb4b ext/ftp: Returning a boolean value using RETURN_BOOL (#21187) 2026-02-10 12:26:18 +00:00
Arshid
9580d47898 ext/ftp: Use STANDARD_MODULE_HEADER instead of STANDARD_MODULE_HEADER_EX (#21088) 2026-01-30 09:05:43 +00:00
David Carlier
50abef95bd Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20603 issue on windows 32 bits.
2025-12-03 20:23:01 +00:00
David Carlier
f90d1f7aa6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20603 issue on windows 32 bits.
2025-12-03 20:22:50 +00:00
David Carlier
51f4450b47 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20603 issue on windows 32 bits.
2025-12-03 20:22:38 +00:00
David Carlier
ff51ac161d Fix GH-20603 issue on windows 32 bits.
the timeout needed to be unsigned.

close GH-20634
2025-12-03 20:22:14 +00:00
David Carlier
71d11bdb16 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:41 +00:00
David Carlier
227541cb96 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:15 +00:00
David Carlier
1701589884 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:05:37 +00:00
David Carlier
4312a446d0 Fix GH-20601: ftp_connect() timeout argument overflow.
close GH-20603
2025-11-29 23:05:14 +00:00
Niels Dossche
23674d9482 Merge branch 'PHP-8.5'
* PHP-8.5:
  ftp: Fix weird typo (#20295)
2025-10-26 08:57:26 +01:00
Niels Dossche
393302bc62 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ftp: Fix weird typo (#20295)
2025-10-26 08:57:21 +01:00
Niels Dossche
d4030362cf Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ftp: Fix weird typo (#20295)
2025-10-26 08:57:14 +01:00
Niels Dossche
61b0d589d6 ftp: Fix weird typo (#20295)
* ftp: Fix weird typo

In 8827f8eca9 the async functions were
renamed to nb functions. So this was just a find+replace of async to nb.
The diff shows that "no asyncronous transfer to continue" was replaced
with "no nbronous transfer to continue". Makes no sense.

* Update ext/ftp/php_ftp.c

Co-authored-by: Jakub Zelenka <bukka@php.net>

---------

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-10-26 08:56:56 +01:00
Tim Düsterhus
9a36e513a6 ftp: Use true / false instead of 1 / 0 when assigning to bool
Changes done with Coccinelle:

    @@
    bool b;
    @@

    - b = 0
    + b = false

    @@
    bool b;
    @@

    - b = 1
    + b = true
2025-09-24 18:51:40 +02:00
Gina Peter Banyard
c8559648fa [skip ci] ext/ftp: Fix typos 2025-04-03 22:47:13 +01:00
Gina Peter Banyard
169573bcb5 ext/ftp: Use bool type instead of int type 2025-04-03 22:47:13 +01:00
Gina Peter Banyard
c9d23c96d6 ext/ftp: Use new php_streams fast ZPP specifier 2025-03-03 18:08:23 +00:00
Arnaud Le Blanc
11accb5cdf Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Niels Dossche
93d3ae28e1 Remove obsolete OpenSSL code in ext/ftp MINIT (#13793)
Follow-up on GH-13498.
These functions inside this #if block are either deprecated
or do nothing anymore on OpenSSL versions >= 1.1.0.
2024-03-23 19:32:44 +01:00
Ayesh Karunaratne
3de3e137bf ext/openssl: Bump minimum required OpenSSL version to 1.1.1
Bumps the minimum required OpenSSL version from 1.0.2 to 1.1.1.

OpenSSL 1.1.1 is an LTS release, but has reached[^1] EOL from upstream. However, Linux distro/OS vendors
continue to ship OpenSSL 1.1.1, so 1.1.1 was picked as the minimum. The current minimum 1.0.2 reached
EOL in 2018.

Bumping the minimum required OpenSSL version makes it possible for ext-openssl to remove a bunch of
conditional code, and assume that TLS 1.3 (shipped with OpenSSL 1.1.1) will be supported everywhere.

 - Debian buster: 1.1.1[^2]
 - Ubuntu 20.04: 1.1.1[^3]
 - CentOS/RHEL 7: 1.0.2
 - RHEL 8/Rocky 8/EL 8: 1.1.1
 - Fedora 38: 3.0.9 (`openssl11` provides OpenSSL 1.1 as well)

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum OpenSSL version.

[^1]: https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/index.html
[^2]: https://packages.debian.org/buster/libssl-dev
[^3]: https://packages.ubuntu.com/focal/libssl-dev
2024-03-23 15:12:06 +00:00
Ilija Tovilo
cfba9cd4bd Merge branch 'PHP-8.2'
* PHP-8.2:
  Propagate success status of ftp_close() to userland
2023-03-03 15:26:51 +01:00
Ilija Tovilo
4c2ee6fa21 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Propagate success status of ftp_close() to userland
2023-03-03 15:26:45 +01:00
nielsdos
abc6fe8f2e Propagate success status of ftp_close() to userland
The docs say that this function returns true on success, and false on
error. This function always returns true in the current implementation
because the success return value from ftp_close() is never propagated to
userland. This affects one test: since the test server exits after an
invalid login, the ftp close correctly fails (because the server has
gone away).
2023-03-03 15:26:11 +01:00
Máté Kocsis
7936c8085e Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Tim Düsterhus
f9fa6d0415 Mark parameter in ext/ftp as sensitive 2022-06-13 11:09:12 +02:00
Máté Kocsis
debd38f851 Add support for sensitive parameters in stubs 2022-06-04 18:15:05 +02:00
Máté Kocsis
4976483960 Declare ext/ftp constants in stubs (#8703) 2022-06-04 11:59:37 +02:00
Joe Watkins
570d9b63e9 Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
d982f4eb28 Use free_obj handler in FTPConnection 2021-06-09 12:13:15 +02:00
Ayesh Karunaratne
68224f2a41 Move FTP extension class FTPConnection to FTP\Connection
With the [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, renaming the new `\FTPConnection` class to `\FTP\Connection`.
This also adds an entry to `./UPGRADING` file.

Related: #6925, #5945
2021-05-08 16:40:10 +02:00
KsaR
01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Christoph M. Becker
895185e5ea Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #79100: Wrong FTP error messages
2021-05-03 15:25:17 +02:00
Christoph M. Becker
c2a06f5d9a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79100: Wrong FTP error messages
2021-05-03 15:24:17 +02:00
Christoph M. Becker
42c72ef463 Fix #79100: Wrong FTP error messages
First we need to properly clear the `inbuf`, what is an amendment to
commit d2881adcbc[1].

Then we need to report `php_pollfd_for_ms()` failures right away; just
setting `errno` does not really help, since at least in some cases it
would have been overwritten before we actually could check it.  We use
`php_socket_strerror()` to get a proper error message, and define
`ETIMEDOUT` to the proper value on Windows; otherwise we catch the
definition in errno.h, which is not compatible with WinSock.  The
proper solution for this issue would likely be to include something
like ext/sockets/windows_common.h.

Finally, we ensure that we only report warnings using `inbuf`, if it is
not empty.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=d2881adcbc9be60de7e7d45a3316b0e11b7eb1e8>.

Closes GH-6718.
2021-05-03 15:19:57 +02:00
Máté Kocsis
98fb565c74 Generate class entries from stubs for another batch of extensions
Closes GH-6669
2021-02-08 19:53:55 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Ayesh Karunaratne
012439b78e FTP: Disallow direct FTPConnection construction
Similar to other resource to object migrations, `FTPConnection` class is not allowed to be constructed with `new FTPConnection`.
Related to b4503fbf88.

Closes GH-6533.
2020-12-23 09:54:38 +01:00
Sara Golemon
b4503fbf88 Convert FTP resource to object 2020-10-21 22:29:23 +00:00
Máté Kocsis
e950ca13ea Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Máté Kocsis
1410cd6b08 Promote warnings to exceptions in ext/ftp
Closes GH-6054
2020-08-31 12:49:17 +02:00
George Peter Banyard
fa8d9b1183 Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002
2020-08-28 15:41:27 +02:00
Max Semenik
2b5de6f839 Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
George Peter Banyard
8a18116dba Fix [-Wundef] warning in FTP extension 2020-05-16 15:31:17 +02:00
Máté Kocsis
5322de1ba8 Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Máté Kocsis
736b22dc0b Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Máté Kocsis
d1764ca330 Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
bbcfa66e06 Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Máté Kocsis
382a038e05 Use ZEND_THROWS() during ZPP in enchant, exif, fileinfo, filter, and FTP extensions 2019-12-31 00:21:37 +01:00