From 07988e73181dcbc6fa4c71de155ecd0da8a9f82f Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Fri, 19 May 2006 21:17:01 +0000
Subject: [PATCH] The fix for jira#1581 was relaxing other checks too

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@407914 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/util/XMLUri.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/xercesc/util/XMLUri.cpp b/src/xercesc/util/XMLUri.cpp
index a0d5fdc32..e9aae097c 100644
--- a/src/xercesc/util/XMLUri.cpp
+++ b/src/xercesc/util/XMLUri.cpp
@@ -2443,8 +2443,12 @@ bool XMLUri::processPath(const XMLCh* const pathStr,
                     !XMLString::isHex(pathStr[index+2]))
                         return false;
             }
-            else if ((testChar==chSpace && !bAllowSpaces) &&
-                     !isUnreservedCharacter(testChar) &&
+            else if (testChar==chSpace)
+            {
+                if(!bAllowSpaces)
+                    return false;
+            }
+            else if (!isUnreservedCharacter(testChar) &&
                      ((isOpaque && !isPathCharacter(testChar)) ||
                       (!isOpaque && !isReservedCharacter(testChar))))
             {
@@ -2476,8 +2480,12 @@ bool XMLUri::processPath(const XMLCh* const pathStr,
                         !XMLString::isHex(pathStr[index+2]))
                         return false;
                 }
-                else if ((testChar==chSpace && !bAllowSpaces) &&
-                         !isReservedOrUnreservedCharacter(testChar))                    
+                else if (testChar==chSpace)
+                {
+                    if(!bAllowSpaces)
+                        return false;
+                }
+                else if (!isReservedOrUnreservedCharacter(testChar))                    
                 {
                     return false;
                 }
-- 
GitLab