Skip to content

Commit 1288c07

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix context option check for "overwrite" in FTP
2 parents 7d18849 + 1d369a8 commit 1288c07

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ PHP NEWS
88
- Date:
99
. Fixed bug GH-11368 (Date modify returns invalid datetime). (Derick)
1010

11+
- FTP:
12+
. Fix context option check for "overwrite". (JonasQuinten)
13+
1114
- PCNTL:
1215
. Fixed bug GH-11498 (SIGCHLD is not always returned from proc_open).
1316
(nielsdos)

ext/standard/ftp_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
490490
} else if (read_write == 2) {
491491
/* when writing file (but not appending), it must NOT exist, unless a context option exists which allows it */
492492
if (context && (tmpzval = php_stream_context_get_option(context, "ftp", "overwrite")) != NULL) {
493-
allow_overwrite = Z_LVAL_P(tmpzval) ? 1 : 0;
493+
allow_overwrite = zend_is_true(tmpzval);
494494
}
495495
if (result <= 299 && result >= 200) {
496496
if (allow_overwrite) {

0 commit comments

Comments
 (0)