From 9433e78da8c47b791f39e5d5e1182a84f7c7eebf Mon Sep 17 00:00:00 2001 From: wodim Date: Sat, 26 Aug 2017 21:52:52 +0200 Subject: Fix the second parameter of $context.getSSLCertInfo not being optional --- src/modules/context/libkvicontext.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/modules/context/libkvicontext.cpp') diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 163e4e86b..ef575d681 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -655,7 +655,7 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) QString szQuery; QString szType; QString szParam1; - bool bRemote = true; + bool bRemote; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("query", KVS_PT_STRING, 0, szQuery) @@ -689,16 +689,17 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) { bRemote = false; } + else if(szType.compare("remote") == 0 || szType.isEmpty()) + { + bRemote = true; + } else { - // already defaults to true, we only catch the error condition - if(szType.compare("remote") != 0) - { - c->warning(__tr2qs("You specified a bad string for the parameter \"type\"")); - c->returnValue()->setString(""); - return true; - } + c->warning(__tr2qs("You specified a bad string for the parameter \"type\"")); + c->returnValue()->setString(""); + return true; } + //context is never null, connection can be null if(!pConsole->context()->connection()) { -- cgit v1.3.1-10-gc9f91