Make JsonStore path parsing more robust. Should fix the

invalid path problem.
This commit is contained in:
Mic Bowman
2013-02-08 22:43:15 -08:00
parent 6d825d7ea2
commit 7bb82c8f2e
2 changed files with 59 additions and 21 deletions

View File

@@ -301,7 +301,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
[ScriptInvocation]
public string JsonList2Path(UUID hostID, UUID scriptID, object[] pathlist)
{
return JsonStore.CanonicalPathExpression(ConvertList2Path(pathlist));
string ipath = ConvertList2Path(pathlist);
string opath;
if (JsonStore.CanonicalPathExpression(ipath,out opath))
return opath;
// This won't parse if passed to the other routines as opposed to
// returning an empty string which is a valid path and would overwrite
// the entire store
return "**INVALID**";
}
// -----------------------------------------------------------------
@@ -421,6 +430,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
// -----------------------------------------------------------------
protected void GenerateRuntimeError(string msg)
{
m_log.InfoFormat("[JsonStore] runtime error: {0}",msg);
throw new Exception("JsonStore Runtime Error: " + msg);
}