diff --git a/UPGRADING b/UPGRADING index a4df23352639..875e05554566 100644 --- a/UPGRADING +++ b/UPGRADING @@ -28,6 +28,9 @@ PHP 8.7 UPGRADE NOTES converted to an int. . Nested arrays in CURLOPT_POSTFIELDS now throw a TypeError, instead of being silently converted to the string "Array". + . Negative values for CURLOPT_POSTREDIR are now rejected, making + curl_setopt() return false, instead of being silently interpreted as a + combination of redirect types. - PDO: . PDOStatement::bindColumn() now throws a ValueError when the column name is diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 44724428beb1..94618e4bf74d 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1892,6 +1892,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_TCP_KEEPCNT: #endif case CURLOPT_FOLLOWLOCATION: + case CURLOPT_POSTREDIR: lval = zval_get_long(zvalue); if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) && (PG(open_basedir) && *PG(open_basedir)) && (lval & CURLPROTO_FILE)) { @@ -2259,11 +2260,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue error = curl_easy_setopt(ch->cp, option, (curl_off_t)lval); break; - case CURLOPT_POSTREDIR: - lval = zval_get_long(zvalue); - error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, (long) (lval & CURL_REDIR_POST_ALL)); - break; - /* the following options deal with files, therefore the open_basedir check * is required. */