[cpp-xmltooling] branch master updated: SSPCPP-791 use XMLTooling::encode() rather than private version

Rod Widdowson rdw at steadingsoftware.com
Thu Apr 5 08:15:39 EDT 2018


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository cpp-xmltooling.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-xmltooling.git;a=commit;h=2fad6a3147d642d5f6e304646888dbc5a35b1d7e

The following commit(s) were added to refs/heads/master by this push:
       new  2fad6a3   SSPCPP-791 use XMLTooling::encode() rather than private version
2fad6a3 is described below

commit 2fad6a3147d642d5f6e304646888dbc5a35b1d7e
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Apr 5 13:08:34 2018 +0100

    SSPCPP-791 use XMLTooling::encode() rather than private version
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-791
    
    The helper function xml_encode(pre, what, post) remains,
    but is uses the helper function internally.
---
 xmltooling/exceptions.cpp | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/xmltooling/exceptions.cpp b/xmltooling/exceptions.cpp
index 6ff78ca..e722a56 100644
--- a/xmltooling/exceptions.cpp
+++ b/xmltooling/exceptions.cpp
@@ -185,24 +185,7 @@ const char* XMLToolingException::getMessage() const
 void xml_encode(string& s, const char* pre, const char* start, const char* post)
 {
     s += pre;
-    size_t pos;
-    while (start && *start) {
-        pos = strcspn(start, "\"<>&");
-        if (pos > 0) {
-            s.append(start, pos);
-            start += pos;
-        }
-        else {
-            switch (*start) {
-                case '\'':  s += "'";     break;
-                case '<':   s += "<";       break;
-                case '>':   s += ">";       break;
-                case '&':   s += "&";      break;
-                default:    s += *start;
-            }
-            start++;
-        }
-    }
+    s += XMLHelper::encode(start);
     s += post;
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list