Don't fail to enable permissions modules correctly if there is any leading or trailing whitespace between comma separate module combinations.

0.8.0.3
Justin Clark-Casey (justincc) 2014-03-25 00:19:24 +00:00
parent ccf18fd2ef
commit e12c044eab
2 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
@ -160,7 +161,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules", string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules",
new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
List<string> modules = new List<string>(permissionModules.Split(',')); List<string> modules = new List<string>(permissionModules.Split(',').Select(m => m.Trim()));
if (!modules.Contains("DefaultPermissionsModule")) if (!modules.Contains("DefaultPermissionsModule"))
return; return;

View File

@ -26,8 +26,9 @@
*/ */
using System; using System;
using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using log4net; using log4net;
using Mono.Addins; using Mono.Addins;
using Nini.Config; using Nini.Config;
@ -62,7 +63,7 @@ namespace OpenSim.Region.OptionalModules
string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules", string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules",
new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
List<string> modules=new List<string>(permissionModules.Split(',')); List<string> modules = new List<string>(permissionModules.Split(',').Select(m => m.Trim()));
if(!modules.Contains("PrimLimitsModule")) if(!modules.Contains("PrimLimitsModule"))
return; return;