From 1b826b487739220503458ccc6b07ec40c54e1164 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 16 Dec 2012 09:48:37 +0200
Subject: Allow registering regions whose names are equivalent under LIKE but
not truly equal
---
OpenSim/Framework/Util.cs | 11 +++++++++++
1 file changed, 11 insertions(+)
(limited to 'OpenSim/Framework/Util.cs')
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 4fd8a2d..f511494 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2102,5 +2102,16 @@ namespace OpenSim.Framework
return firstName + "." + lastName + " " + "@" + uri.Authority;
}
#endregion
+
+ ///
+ /// Escapes the special characters used in "LIKE".
+ ///
+ ///
+ /// For example: EscapeForLike("foo_bar%baz") = "foo\_bar\%baz"
+ ///
+ public static string EscapeForLike(string str)
+ {
+ return str.Replace("_", "\\_").Replace("%", "\\%");
+ }
}
}
--
cgit v1.1