diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 5e7420b4a5..8ebf144c2a 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -409,7 +409,7 @@ namespace OpenSim private void HandleCreateRegion(string module, string[] cmd) { - if (cmd.Length < 4) + if (cmd.Length < 4 || !cmd[3].EndsWith(".xml")) { m_console.Error("Usage: create region "); return; @@ -418,14 +418,8 @@ namespace OpenSim string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]); // Allow absolute and relative specifiers - if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith("..") || cmd[3].EndsWith(".xml")) - { + if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith("..")) regionFile = cmd[3]; - } - else - { - m_console.Error("Usage: create region "); - } IScene scene; CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); @@ -1111,4 +1105,4 @@ namespace OpenSim #endregion } -} \ No newline at end of file +}