Skip to content

Commit 8199e5a

Browse files
committed
adapt patch for 7.1
1 parent e53f967 commit 8199e5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/com_dotnet/com_com.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ PHP_FUNCTION(com_create_instance)
5353
&authid, EOAC_NONE
5454
};
5555
zend_long cp = CP_ACP;
56+
const struct php_win32_cp *cp_it;
5657

5758
php_com_initialize();
5859
obj = CDNO_FETCH(object);
@@ -70,7 +71,8 @@ PHP_FUNCTION(com_create_instance)
7071
return;
7172
}
7273

73-
if (Z_L(0) > cp || ZEND_LONG_INT_OVFL(cp)) {
74+
cp_it = php_win32_cp_get_by_id((DWORD)cp);
75+
if (!cp_it) {
7476
php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid codepage!");
7577
return;
7678
}

0 commit comments

Comments
 (0)