]> granicus.if.org Git - php/commitdiff
Open files in binary mode - should fix readfile() on Windows
authorStanislav Malyshev <stas@php.net>
Tue, 12 Dec 2000 17:42:53 +0000 (17:42 +0000)
committerStanislav Malyshev <stas@php.net>
Tue, 12 Dec 2000 17:42:53 +0000 (17:42 +0000)
ext/standard/file.c

index d421230de7a53d05088cb5837ea400bd13538e17..854bdeb083b503670a9fcbd4b5c6832d1190b9aa 100644 (file)
@@ -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));