[php-src] PR #11332: fix: use zval_get_long() to read value of FTP context option "overwrite"
| From: | JonasQuinten | Date: | Sun, 28 May 2023 14:15:28 +0000 |
| Subject: | [php-src] PR #11332: fix: use zval_get_long() to read value of FTP context option "overwrite" | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22605@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11332
Author: JonasQuinten
The FTP context option "overwrite" is read directly via Z_LVAL_P without performing a type
check or conversion. Because of this, the option only works reliably if it's set to an integer
or if it's absent (defaulting to false), while setting it explicitly to false or null will
likely **allow** overwriting and setting it to true has a small chance of disabling it.
I tried to implement the behavior as described in the commit that added the option
(https://github.com/php/php-src/commit/cb89565ba4deab745e38b9d9f93f3e504d3b2f55):
> Allow overwriting of files via ftp:// wrapper.
> Requires context option: $context['ftp']['overwrite'] != 0