diff --git a/OpenSim/Region/CoreModules/Avatar/Search/AvatarSearchModule.cs b/OpenSim/Region/CoreModules/Avatar/Search/AvatarSearchModule.cs index 2cf9a229..79093664 100644 --- a/OpenSim/Region/CoreModules/Avatar/Search/AvatarSearchModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Search/AvatarSearchModule.cs @@ -116,14 +116,20 @@ public void Initialize(Scene scene, IConfigSource config) IConfig myConfig = config.Configs["Startup"]; string connstr = myConfig.GetString("core_connection_string", String.Empty); _rdbConnectionTemplate = myConfig.GetString("rdb_connection_template", String.Empty); - if (!_rdbConnectionTemplate.Contains("Data Source")) + if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplate)) { - _rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate; + if (!_rdbConnectionTemplate.ToLower().Contains("data source")) + { + _rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate; + } } _rdbConnectionTemplateDebug = myConfig.GetString("rdb_connection_template_debug", String.Empty); - if (!_rdbConnectionTemplateDebug.Contains("Data Source")) + if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplateDebug)) { - _rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug; + if (!_rdbConnectionTemplateDebug.ToLower().Contains("data source")) + { + _rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug; + } } _connFactory = new ConnectionFactory("MySQL", connstr); diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 2041608d..57fdcedd 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -117,14 +117,20 @@ public void Initialize(Scene scene, IConfigSource config) IConfig myConfig = config.Configs["Startup"]; string connstr = myConfig.GetString("core_connection_string", String.Empty); _rdbConnectionTemplate = myConfig.GetString("rdb_connection_template", String.Empty); - if (!_rdbConnectionTemplate.Contains("Data Source")) + if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplate)) { - _rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate; + if (!_rdbConnectionTemplate.ToLower().Contains("data source")) + { + _rdbConnectionTemplate = "Data Source={0};" + _rdbConnectionTemplate; + } } _rdbConnectionTemplateDebug = myConfig.GetString("rdb_connection_template_debug", String.Empty); - if (!_rdbConnectionTemplateDebug.Contains("Data Source")) + if (!String.IsNullOrWhiteSpace(_rdbConnectionTemplateDebug)) { - _rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug; + if (!_rdbConnectionTemplateDebug.ToLower().Contains("data source")) + { + _rdbConnectionTemplateDebug = "Data Source={0};" + _rdbConnectionTemplateDebug; + } } _connFactory = new ConnectionFactory("MySQL", connstr);