[cpp-sp COMMIT] in /branches/REL_2: plugins/TemplateAttributeResolver.cpp plugins/TransformAttributeResolver.cpp shib...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Jul 6 17:39:44 EDT 2012
Author: scantor
Date: Fri Jul 6 17:39:44 2012
New Revision: 3724
URL: http://svn.shibboleth.net/view/cpp-sp?rev=3724&view=rev
Log:
https://issues.shibboleth.net/jira/browse/SSPCPP-472
Modified:
branches/REL_2/plugins/TemplateAttributeResolver.cpp
branches/REL_2/plugins/TransformAttributeResolver.cpp
branches/REL_2/shibsp/attribute/ExtensibleAttribute.cpp
branches/REL_2/shibsp/attribute/NameIDAttribute.cpp
Modified: branches/REL_2/plugins/TemplateAttributeResolver.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/TemplateAttributeResolver.cpp?rev=3724&r1=3723&r2=3724&view=diff
==============================================================================
--- branches/REL_2/plugins/TemplateAttributeResolver.cpp (original)
+++ branches/REL_2/plugins/TemplateAttributeResolver.cpp Fri Jul 6 17:39:44 2012
@@ -213,6 +213,7 @@
if (start != string::npos && start < m_template.length())
processed += m_template.substr(start, i); // append rest of string
+ trim(processed);
if (processed.empty())
dest->getValues().pop_back();
}
Modified: branches/REL_2/plugins/TransformAttributeResolver.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/TransformAttributeResolver.cpp?rev=3724&r1=3723&r2=3724&view=diff
==============================================================================
--- branches/REL_2/plugins/TransformAttributeResolver.cpp (original)
+++ branches/REL_2/plugins/TransformAttributeResolver.cpp Fri Jul 6 17:39:44 2012
@@ -28,6 +28,7 @@
#include <algorithm>
#include <boost/shared_ptr.hpp>
+#include <boost/algorithm/string/trim.hpp>
#include <boost/tuple/tuple.hpp>
#include <shibsp/exceptions.h>
#include <shibsp/SessionCache.h>
@@ -232,10 +233,12 @@
if (dest) {
// Modify in place.
dest->getValues()[i] = narrow.get();
+ trim(dest->getValues()[i]);
}
else {
// Add to new object.
destwrapper->getValues().push_back(narrow.get());
+ trim(destwrapper->getValues().back());
}
}
}
Modified: branches/REL_2/shibsp/attribute/ExtensibleAttribute.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/attribute/ExtensibleAttribute.cpp?rev=3724&r1=3723&r2=3724&view=diff
==============================================================================
--- branches/REL_2/shibsp/attribute/ExtensibleAttribute.cpp (original)
+++ branches/REL_2/shibsp/attribute/ExtensibleAttribute.cpp Fri Jul 6 17:39:44 2012
@@ -28,6 +28,8 @@
#include "SPConfig.h"
#include "attribute/ExtensibleAttribute.h"
#include "util/SPConstants.h"
+
+#include <boost/algorithm/string/trim.hpp>
using namespace shibsp;
using namespace xmltooling;
@@ -103,20 +105,20 @@
string& processed = m_serialized.back();
string::size_type i=0,start=0;
- while (start!=string::npos && start<msg.length() && (i=msg.find("$",start))!=string::npos) {
+ while (start != string::npos && start < msg.length() && (i = msg.find("$",start)) != string::npos) {
if (i>start)
- processed += msg.substr(start,i-start); // append everything in between
- start=i+1; // move start to the beginning of the token name
- i=msg.find_first_not_of(legal,start); // find token delimiter
- if (i==start) { // append a non legal character
- processed+=msg[start++];
+ processed += msg.substr(start, i-start); // append everything in between
+ start = i+1; // move start to the beginning of the token name
+ i = msg.find_first_not_of(legal, start); // find token delimiter
+ if (i == start) { // append a non legal character
+ processed += msg[start++];
continue;
}
- string tag = msg.substr(start,(i==string::npos) ? i : i-start);
+ string tag = msg.substr(start, (i==string::npos) ? i : i-start);
if (tag == "_string" && val.string()) {
processed += val.string();
- start=i;
+ start = i;
}
else {
DDF child = val.getmember(tag.c_str());
@@ -124,11 +126,12 @@
processed += child.string();
else if (child.isstruct() && child["_string"].string())
processed += child["_string"].string();
- start=i;
[... 47 lines stripped ...]
More information about the commits
mailing list