From 4b622ec8815cb7de37db701aa33b693120263fe0 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 19 May 2008 18:30:25 +0000 Subject: (from awebb) Fixes a bug in BaseRequestHandler. If the length of the patter is equal to, or greater than, the length of the actual request path, then an exception is thrown. System using is added to support use of String.Empty. Exception is used to ensure most efficient operation on (assumed to be most common) successful case. --- OpenSim/Framework/Servers/BaseRequestHandler.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/BaseRequestHandler.cs b/OpenSim/Framework/Servers/BaseRequestHandler.cs index f9f2d8f..ddc8e92 100644 --- a/OpenSim/Framework/Servers/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/BaseRequestHandler.cs @@ -25,6 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; + namespace OpenSim.Framework.Servers { public class BaseRequestHandler @@ -56,7 +58,14 @@ namespace OpenSim.Framework.Servers protected string GetParam(string path) { - return path.Substring(m_path.Length); + try + { + return path.Substring(m_path.Length); + } + catch (Exception) + { + return String.Empty; + } } } } -- cgit v1.1