File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
197
197
char * where = "" ;
198
198
IUnknown * unk = NULL ;
199
199
zend_long cp = CP_ACP ;
200
+ const struct php_win32_cp * cp_it ;
200
201
201
202
php_com_initialize ();
202
203
stuff = (struct dotnet_runtime_stuff * )COMG (dotnet_runtime_stuff );
@@ -251,11 +252,12 @@ PHP_FUNCTION(com_dotnet_create_instance)
251
252
return ;
252
253
}
253
254
254
- if (Z_L (0 ) > cp || ZEND_LONG_INT_OVFL (cp )) {
255
+ cp_it = php_win32_cp_get_by_id ((DWORD )cp );
256
+ if (!cp_it ) {
255
257
php_com_throw_exception (E_INVALIDARG , "Could not create .Net object - invalid codepage!" );
256
258
return ;
257
259
}
258
- obj -> code_page = (int )cp ;
260
+ obj -> code_page = (int )cp_it -> id ;
259
261
260
262
oletype = php_com_string_to_olestring (datatype_name , datatype_name_len , obj -> code_page );
261
263
oleassembly = php_com_string_to_olestring (assembly_name , assembly_name_len , obj -> code_page );
You can’t perform that action at this time.
0 commit comments