diff options
Diffstat (limited to 'OpenSim/Server/Base/ServerUtils.cs')
-rw-r--r-- | OpenSim/Server/Base/ServerUtils.cs | 29 |
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; | |||
31 | using System.Xml; | 31 | using System.Xml; |
32 | using System.Xml.Serialization; | 32 | using System.Xml.Serialization; |
33 | using System.Text; | 33 | using System.Text; |
34 | using System.Collections.Generic; | ||
34 | using log4net; | 35 | using log4net; |
35 | using OpenSim.Framework; | 36 | using 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 | } |