]> granicus.if.org Git - php/commitdiff
Fix realpath() in unicode mode
authorSara Golemon <pollita@php.net>
Mon, 9 Oct 2006 02:52:27 +0000 (02:52 +0000)
committerSara Golemon <pollita@php.net>
Mon, 9 Oct 2006 02:52:27 +0000 (02:52 +0000)
ext/standard/file.c

index 25646e3f25ba47e32c1dd6f939e008fae4671f04..21e2393c45a4bd7fc8ad9453c1aff58d8342ddaf 100644 (file)
@@ -2432,10 +2432,11 @@ PHP_FUNCTION(realpath)
                        UChar *path;
                        int path_len;
 
-                       if (php_stream_path_decode(&php_plain_files_wrapper, &path, &path_len, filename, filename_len, REPORT_ERRORS, FG(default_context)) == SUCCESS) {
+                       if (php_stream_path_decode(&php_plain_files_wrapper, &path, &path_len, resolved_path_buff, strlen(resolved_path_buff), REPORT_ERRORS, FG(default_context)) == SUCCESS) {
                                RETVAL_UNICODEL(path, path_len, 0);
                        } else {
-                               RETVAL_FALSE;
+                               /* Fallback */
+                               RETVAL_STRING(resolved_path_buff, 1);
                        }
                } else {
                        RETVAL_STRING(resolved_path_buff, 1);