]> granicus.if.org Git - php/commitdiff
Remove include_path support from md5_file/sha1_file again
authorUwe Schindler <thetaphi@php.net>
Fri, 15 Apr 2005 17:13:54 +0000 (17:13 +0000)
committerUwe Schindler <thetaphi@php.net>
Fri, 15 Apr 2005 17:13:54 +0000 (17:13 +0000)
NEWS
ext/standard/md5.c
ext/standard/sha1.c

diff --git a/NEWS b/NEWS
index 27c14f6706a51f69e6b44a3fa67f141cbc2e1564..7b2be7cf8b3075fe8c2cd35c57b4622e6c9ac795 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,7 @@ PHP                                                                        NEWS
   . pg_result_error_field() - highly detailed error information, 
     most importantly the SQLSTATE error code.
   . pg_set_error_verbosity() - set verbosity of errors.
+- Changed sha1_file() / md5_file() to use streams instead of low level IO (Uwe)
 - Added optional fifth parameter "count" to preg_replace_callback() and
   preg_replace() to count the number of replacements made. FR #32275. (Andrey)
 - Added optional third parameter "charlist" to str_word_count() which
index 85d9f4e3ef6fb9b114c405eb5e756e61018fe2d2..00108c49e038b2e563a6fc570d9ccb817de48d77 100644 (file)
@@ -67,14 +67,13 @@ PHP_NAMED_FUNCTION(php_if_md5)
 }
 /* }}} */
 
-/* {{{ proto string md5_file(string filename [, bool raw_output [, bool use_include_path]])
+/* {{{ proto string md5_file(string filename [, bool raw_output])
    Calculate the md5 hash of given filename */
 PHP_NAMED_FUNCTION(php_if_md5_file)
 {
        char          *arg;
        int           arg_len;
        zend_bool raw_output = 0;
-       zend_bool use_include_path = 0;
        char          md5str[33];
        unsigned char buf[1024];
        unsigned char digest[16];
@@ -82,12 +81,11 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
        int           n;
        php_stream    *stream;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bb", &arg, &arg_len, &raw_output, &use_include_path) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb",
-               (use_include_path ? USE_PATH : 0) | REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
        if (!stream) {
                RETURN_FALSE;
        }
index 76675cee0dff32dbadcba79bc2e563aeb78d2c81..0e132100d58a6ffbc51a1b7cbaa4f37fbff1206b 100644 (file)
@@ -67,14 +67,13 @@ PHP_FUNCTION(sha1)
 /* }}} */
 
 
-/* {{{ proto string sha1_file(string filename [, bool raw_output [, bool use_include_path]])
+/* {{{ proto string sha1_file(string filename [, bool raw_output])
    Calculate the sha1 hash of given filename */
 PHP_FUNCTION(sha1_file)
 {
        char          *arg;
        int           arg_len;
        zend_bool raw_output = 0;
-       zend_bool use_include_path = 0;
        char          sha1str[41];
        unsigned char buf[1024];
        unsigned char digest[20];
@@ -82,12 +81,11 @@ PHP_FUNCTION(sha1_file)
        int           n;
        php_stream    *stream;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bb", &arg, &arg_len, &raw_output, &use_include_path) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb",
-               (use_include_path ? USE_PATH : 0) | REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
        if (!stream) {
                RETURN_FALSE;
        }