projects
/
shibboleth
/
cpp-xmltooling.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
033df5e
)
URL encode exception properties for XML-safe transport.
author
Scott Cantor
<cantor.2@osu.edu>
Fri, 27 Mar 2009 17:27:04 +0000
(17:27 +0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Fri, 27 Mar 2009 17:27:04 +0000
(17:27 +0000)
xmltooling/exceptions.cpp
patch
|
blob
|
history
diff --git
a/xmltooling/exceptions.cpp
b/xmltooling/exceptions.cpp
index
ea8aa40
..
170f9d9
100644
(file)
--- a/
xmltooling/exceptions.cpp
+++ b/
xmltooling/exceptions.cpp
@@
-1,5
+1,5
@@
/*
\r
/*
\r
- * Copyright 2001-200
7
Internet2
\r
+ * Copyright 2001-200
9
Internet2
\r
*
\r
* Licensed under the Apache License, Version 2.0 (the "License");
\r
* you may not use this file except in compliance with the License.
\r
*
\r
* Licensed under the Apache License, Version 2.0 (the "License");
\r
* you may not use this file except in compliance with the License.
\r
@@
-249,9
+249,10
@@
string XMLToolingException::toString() const
const char* msg=getMessage();
\r
if (msg)
\r
xml_encode(xml, "<message>", msg, "</message>");
\r
const char* msg=getMessage();
\r
if (msg)
\r
xml_encode(xml, "<message>", msg, "</message>");
\r
+ const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder();
\r
for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
\r
xml_encode(xml, "<param name='", i->first.c_str(), "'");
\r
for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
\r
xml_encode(xml, "<param name='", i->first.c_str(), "'");
\r
- xml_encode(xml, ">",
i->second
.c_str(), "</param>");
\r
+ xml_encode(xml, ">",
encoder->encode(i->second.c_str())
.c_str(), "</param>");
\r
}
\r
xml+="</exception>";
\r
return xml;
\r
}
\r
xml+="</exception>";
\r
return xml;
\r
@@
-295,13
+296,16
@@
XMLToolingException* XMLToolingException::fromStream(std::istream& in)
excep->setMessage(m.get());
\r
}
\r
\r
excep->setMessage(m.get());
\r
}
\r
\r
+ const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder();
\r
child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param);
\r
while (child && child->hasChildNodes()) {
\r
auto_ptr_char n(child->getAttributeNS(NULL,name));
\r
child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param);
\r
while (child && child->hasChildNodes()) {
\r
auto_ptr_char n(child->getAttributeNS(NULL,name));
\r
- char* v=toUTF8(child->getFirstChild()->getNodeValue());
\r
- if (n.get() && v)
\r
- excep->addProperty(n.get(), v);
\r
- delete[] v;
\r
+ char* encoded = XMLString::transcode(child->getFirstChild()->getNodeValue());
\r
+ if (n.get() && encoded) {
\r
+ encoder->decode(encoded);
\r
+ excep->addProperty(n.get(), encoded);
\r
+ }
\r
+ XMLString::release(&encoded);
\r
child=XMLHelper::getNextSiblingElement(child,XMLTOOLING_NS,param);
\r
}
\r
\r
child=XMLHelper::getNextSiblingElement(child,XMLTOOLING_NS,param);
\r
}
\r
\r