1010 | http://www.php.net/license/3_01.txt |
1111 | If you did not receive a copy of the PHP license and are unable to |
1212 | obtain it through the world-wide-web, please send a note to |
13- | license@php.net so we can mail you a copy immediately. |
13+ | license@php.net so we can mail you 6 copy immediately. |
1414 +----------------------------------------------------------------------+
1515 | Author: Sterling Hughes <sterling@php.net> |
1616 +----------------------------------------------------------------------+
@@ -169,8 +169,8 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
169169#if LIBCURL_VERSION_NUM < 0x071100
170170 char * copystr = NULL ;
171171#endif
172- /* Disable file:// if open_basedir or safe_mode are used */
173- if (( PG (open_basedir ) && * PG (open_basedir )) || PG ( safe_mode )) {
172+ /* Disable file:// if open_basedir are used */
173+ if (PG (open_basedir ) && * PG (open_basedir )) {
174174#if LIBCURL_VERSION_NUM >= 0x071304
175175 error = curl_easy_setopt (ch -> cp , CURLOPT_PROTOCOLS , CURLPROTO_ALL & ~CURLPROTO_FILE );
176176#else
@@ -1664,8 +1664,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
16641664 convert_to_long_ex (zvalue );
16651665#if LIBCURL_VERSION_NUM >= 0x71304
16661666 if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS ) &&
1667- (( PG (open_basedir ) && * PG (open_basedir )) || PG ( safe_mode )) && (Z_LVAL_PP (zvalue ) & CURLPROTO_FILE )) {
1668- php_error_docref (NULL TSRMLS_CC , E_WARNING , "CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set" );
1667+ (PG (open_basedir ) && * PG (open_basedir )) && (Z_LVAL_PP (zvalue ) & CURLPROTO_FILE )) {
1668+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "CURLPROTO_FILE cannot be activated when an open_basedir is set" );
16691669 RETVAL_FALSE ;
16701670 return 1 ;
16711671 }
@@ -1674,9 +1674,9 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
16741674 break ;
16751675 case CURLOPT_FOLLOWLOCATION :
16761676 convert_to_long_ex (zvalue );
1677- if (( PG (open_basedir ) && * PG (open_basedir )) || PG ( safe_mode )) {
1677+ if (PG (open_basedir ) && * PG (open_basedir )) {
16781678 if (Z_LVAL_PP (zvalue ) != 0 ) {
1679- php_error_docref (NULL TSRMLS_CC , E_WARNING , "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set" );
1679+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set" );
16801680 RETVAL_FALSE ;
16811681 return 1 ;
16821682 }
@@ -1728,7 +1728,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
17281728 option == CURLOPT_SSH_PUBLIC_KEYFILE || option == CURLOPT_SSH_PRIVATE_KEYFILE
17291729
17301730 ) {
1731- if (php_check_open_basedir (Z_STRVAL_PP (zvalue ) TSRMLS_CC ) || ( PG ( safe_mode ) && ! php_checkuid ( Z_STRVAL_PP ( zvalue ), "rb+" , CHECKUID_CHECK_MODE_PARAM )) ) {
1731+ if (php_check_open_basedir (Z_STRVAL_PP (zvalue ) TSRMLS_CC )) {
17321732 RETVAL_FALSE ;
17331733 return 1 ;
17341734 }
@@ -1938,8 +1938,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
19381938 if ((filename = php_memnstr (postval , ";filename=" , sizeof (";filename=" ) - 1 , postval + Z_STRLEN_PP (current )))) {
19391939 * filename = '\0' ;
19401940 }
1941- /* safe_mode / open_basedir check */
1942- if (php_check_open_basedir (postval TSRMLS_CC ) || ( PG ( safe_mode ) && ! php_checkuid ( postval , "rb+" , CHECKUID_CHECK_MODE_PARAM )) ) {
1941+ /* open_basedir check */
1942+ if (php_check_open_basedir (postval TSRMLS_CC )) {
19431943 RETVAL_FALSE ;
19441944 return 1 ;
19451945 }
@@ -2028,8 +2028,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
20282028
20292029 break ;
20302030 }
2031- /* the following options deal with files, therefor safe_mode & open_basedir checks
2032- * are required.
2031+ /* the following options deal with files, therefore the open_basedir check
2032+ * is required.
20332033 */
20342034 case CURLOPT_COOKIEJAR :
20352035 case CURLOPT_SSLCERT :
@@ -2041,7 +2041,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
20412041
20422042 convert_to_string_ex (zvalue );
20432043
2044- if (php_check_open_basedir (Z_STRVAL_PP (zvalue ) TSRMLS_CC ) || ( PG ( safe_mode ) && ! php_checkuid ( Z_STRVAL_PP ( zvalue ), "rb+" , CHECKUID_CHECK_MODE_PARAM )) ) {
2044+ if (php_check_open_basedir (Z_STRVAL_PP (zvalue ) TSRMLS_CC )) {
20452045 RETVAL_FALSE ;
20462046 return 1 ;
20472047 }
0 commit comments