Skip to content

Commit 168fbc3

Browse files
committed
ext/curl: handle CURLOPT_POSTREDIR as normal long
Don't treat CURLOPT_POSTREDIR specially. Just pass its value to curl directly. There is no need to do `& CURL_REDIR_POST_ALL`. Curl already does this internally. The only functional change is that negative numbers will now raise an error, which seems reasonable.
1 parent 52767e6 commit 168fbc3

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎ext/curl/interface.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
18431843
case CURLOPT_TCP_KEEPCNT:
18441844
#endif
18451845
case CURLOPT_FOLLOWLOCATION:
1846+
case CURLOPT_POSTREDIR:
18461847
lval = zval_get_long(zvalue);
18471848
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
18481849
(PG(open_basedir) && *PG(open_basedir)) && (lval & CURLPROTO_FILE)) {
@@ -2210,11 +2211,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
22102211
error = curl_easy_setopt(ch->cp, option, (curl_off_t)lval);
22112212
break;
22122213

2213-
case CURLOPT_POSTREDIR:
2214-
lval = zval_get_long(zvalue);
2215-
error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, (long) (lval & CURL_REDIR_POST_ALL));
2216-
break;
2217-
22182214
/* the following options deal with files, therefore the open_basedir check
22192215
* is required.
22202216
*/

0 commit comments

Comments
 (0)