From 710afa6f15eeaa7c26327a888f1793b9a0f42fbd Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Wed, 22 May 2013 08:49:23 +0000 Subject: [PATCH] SAML2: Fix generation of mdui:Keyword with ampersand in keyword. Same problem as fixed in r3241. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3242 44740490-163a-0410-bde0-09ae8108e29a --- lib/SAML2/XML/mdui/Keywords.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/SAML2/XML/mdui/Keywords.php b/lib/SAML2/XML/mdui/Keywords.php index 0cc2893ea..161f5e973 100644 --- a/lib/SAML2/XML/mdui/Keywords.php +++ b/lib/SAML2/XML/mdui/Keywords.php @@ -63,14 +63,15 @@ class SAML2_XML_mdui_Keywords { $e = $doc->createElementNS(SAML2_XML_mdui_UIInfo::NS, 'mdui:Keywords'); $e->setAttribute('xml:lang', $this->lang); - $e->nodeValue = ''; + $value = ''; foreach ($this->Keywords as $keyword) { if (strpos($keyword, "+") !== false) { throw new Exception('Keywords may not contain a "+" character.'); } - $e->nodeValue .= str_replace(' ', '+', $keyword) . ' '; + $value .= str_replace(' ', '+', $keyword) . ' '; } - $e->nodeValue = rtrim($e->nodeValue); + $value = rtrim($value); + $e->appendChild($doc->createTextNode($value)); $parent->appendChild($e); return $e; -- GitLab