summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-05-04 14:55:24 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-05-15 09:23:18 +0200
commit8c6d006b55bf5ba230dda672344dbd0e2a7d4be3 (patch)
tree1fd92cb3324626b7c4f3c26552de0128b984b26a /win32
parent844a1245ef4ec9b57fb1ca10ed87689cfb652dd4 (diff)
downloadphp-git-8c6d006b55bf5ba230dda672344dbd0e2a7d4be3.tar.gz
Fix #79557: extension_dir = ./ext now use current directory for base
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.
Diffstat (limited to 'win32')
-rw-r--r--win32/winutil.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/win32/winutil.c b/win32/winutil.c
index c04664bab3..8cf5cdc1e7 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -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();