]> granicus.if.org Git - php/commitdiff
Fix #79557: extension_dir = ./ext now use current directory for base
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 4 May 2020 12:55:24 +0000 (14:55 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 15 May 2020 07:23:18 +0000 (09:23 +0200)
For some reason, `ImageLoad()` fails to load images with a relative
path starting with `.\`  or `./`.  We work around this issue by
stripping those leading characters.

NEWS
win32/winutil.c

diff --git a/NEWS b/NEWS
index 426bd0b8729afa98d0197390c79112834bd708e4..3f5fe37e25b10b9fa08ebd13492c7a5db344bb4d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP                                                                        NEWS
     called). (Laruence)
   . Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
   . Fixed bug #79489 (.user.ini does not inherit). (cmb)
+  . Fixed bug #79557 (extension_dir = ./ext now use current directory for 
+    base). (cmb)
 
 - FFI:
   . Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
index c04664bab395d83f0be042e9ba9903006faf6a4f..8cf5cdc1e758a1da3462824c9e3157f61f5a1fc7 100644 (file)
@@ -440,7 +440,13 @@ PHP_WINUTIL_API char *php_win32_get_username(void)
 
 static zend_always_inline BOOL is_compatible(const char *name, BOOL is_smaller, char *format, char **err)
 {/*{{{*/
-       PLOADED_IMAGE img = ImageLoad(name, NULL);
+       /* work around ImageLoad() issue */
+       char *name_stripped = name;
+       if (name[0] == '.' && IS_SLASH(name[1])) {
+               name_stripped += 2;
+       }
+
+       PLOADED_IMAGE img = ImageLoad(name_stripped, NULL);
 
        if (!img) {
                DWORD _err = GetLastError();