]> granicus.if.org Git - php/commitdiff
Fixed bug #74589 __DIR__ wrong for unicode character
authorAnatol Belski <ab@php.net>
Mon, 15 May 2017 14:35:22 +0000 (16:35 +0200)
committerAnatol Belski <ab@php.net>
Mon, 15 May 2017 14:35:22 +0000 (16:35 +0200)
Zend/zend_compile.c

index cea28d6ed00c01c90501a4c597caffd36011f0cc..bc4e3f0bd06e3a1e049447fd449cbc4ea71b1e5e 100644 (file)
@@ -6455,7 +6455,11 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
                {
                        zend_string *filename = CG(compiled_filename);
                        zend_string *dirname = zend_string_init(ZSTR_VAL(filename), ZSTR_LEN(filename), 0);
+#ifdef ZEND_WIN32
+                       php_win32_ioutil_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
+#else
                        zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
+#endif
 
                        if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
                                dirname = zend_string_extend(dirname, MAXPATHLEN, 0);