mirror of
https://github.com/php/php-src.git
synced 2026-04-30 03:33:17 +02:00
Open files in binary mode - should fix readfile() on Windows
This commit is contained in:
+3
-3
@@ -271,7 +271,7 @@ PHP_FUNCTION(get_meta_tags)
|
||||
}
|
||||
convert_to_string_ex(filename);
|
||||
|
||||
fp = php_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
if (!fp && !socketd) {
|
||||
if (issock != BAD_URL) {
|
||||
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
|
||||
@@ -406,7 +406,7 @@ PHP_FUNCTION(file)
|
||||
}
|
||||
convert_to_string_ex(filename);
|
||||
|
||||
fp = php_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
if (!fp && !socketd) {
|
||||
if (issock != BAD_URL) {
|
||||
char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
|
||||
@@ -1405,7 +1405,7 @@ PHP_FUNCTION(readfile)
|
||||
* We need a better way of returning error messages from
|
||||
* php_fopen_wrapper().
|
||||
*/
|
||||
fp = php_fopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
|
||||
if (!fp && !socketd){
|
||||
if (issock != BAD_URL) {
|
||||
char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
|
||||
|
||||
Reference in New Issue
Block a user