aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs29
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 8d76ffe..0a36bbe 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -31,6 +31,7 @@ using System.Reflection;
31using System.Xml; 31using System.Xml;
32using System.Xml.Serialization; 32using System.Xml.Serialization;
33using System.Text; 33using System.Text;
34using System.Collections.Generic;
34using log4net; 35using log4net;
35using OpenSim.Framework; 36using OpenSim.Framework;
36 37
@@ -156,5 +157,31 @@ namespace OpenSim.Server.Base
156 return null; 157 return null;
157 } 158 }
158 } 159 }
160
161 public static Dictionary<string, string> ParseQueryString(string query)
162 {
163 Dictionary<string, string> result = new Dictionary<string, string>();
164 string[] terms = query.Split(new char[] {'&'});
165
166 if (terms.Length == 0)
167 return result;
168
169 foreach (string t in terms)
170 {
171 string[] elems = t.Split(new char[] {'='});
172 if (elems.Length == 0)
173 continue;
174
175 string name = System.Web.HttpUtility.UrlDecode(elems[0]);
176 string value = String.Empty;
177
178 if (elems.Length > 1)
179 value = System.Web.HttpUtility.UrlDecode(elems[1]);
180
181 result[name] = value;
182 }
183
184 return result;
185 }
159 } 186 }
160} \ No newline at end of file 187}