Skip to content

Commit

Permalink
Fix whitelist string -> array error in checkPbo
Browse files Browse the repository at this point in the history
Fix #2913
Use splitString instead of call compile to convert string into an array
  • Loading branch information
PabstMirror committed Dec 3, 2015
1 parent c928a0d commit 91ace4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ call FUNC(checkFiles);
[
GVAR(checkPBOsAction),
GVAR(checkPBOsCheckAll),
call compile GVAR(checkPBOsWhitelist)
GVAR(checkPBOsWhitelist)
] call FUNC(checkPBOs)
}] call FUNC(addEventHandler);

Expand Down
10 changes: 7 additions & 3 deletions addons/common/functions/fnc_checkPBOs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 1 = Warn permanently
* 2 = Kick
* 1: Check all PBOs? (default: false) <BOOL>
* 2: Whitelist (default: "[]") <STRING>
* 2: Whitelist (default: "") <STRING>
*
* Return Value:
* None
Expand All @@ -18,9 +18,13 @@
*/
#include "script_component.hpp"

params ["_mode", ["_checkAll", false], ["_whitelist", "[]"]];
params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]];
TRACE_3("params",_mode,_checkAll,_whitelist);

_whitelist = [_whitelist, {toLower _this}] call FUNC(map);
//lowercase and convert whiteList String into array of strings:
_whitelist = toLower _whitelist;
_whitelist = _whitelist splitString "[,""']";
TRACE_1("Array",_whitelist);

ACE_Version_CheckAll = _checkAll;
ACE_Version_Whitelist = _whitelist;
Expand Down

0 comments on commit 91ace4f

Please sign in to comment.