From 8199e5a7e933493e991f402923213b40d01896a9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 12 Dec 2016 01:50:15 +0100 Subject: adapt patch for 7.1 --- ext/com_dotnet/com_com.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 86b3bd1dd5..68252daab0 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -53,6 +53,7 @@ PHP_FUNCTION(com_create_instance) &authid, EOAC_NONE }; zend_long cp = CP_ACP; + const struct php_win32_cp *cp_it; php_com_initialize(); obj = CDNO_FETCH(object); @@ -70,7 +71,8 @@ PHP_FUNCTION(com_create_instance) return; } - if (Z_L(0) > cp || ZEND_LONG_INT_OVFL(cp)) { + cp_it = php_win32_cp_get_by_id((DWORD)cp); + if (!cp_it) { php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid codepage!"); return; } -- cgit v1.2.1