From bf655005d6634483771aaddeac8db6b38f7809d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 17 Mar 2010 13:25:23 +0000
Subject: [PATCH] Backward compatability with metaedit

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2220 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/metaedit/lib/MetaEditor.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/metaedit/lib/MetaEditor.php b/modules/metaedit/lib/MetaEditor.php
index 73049f503..161cbbb7b 100644
--- a/modules/metaedit/lib/MetaEditor.php
+++ b/modules/metaedit/lib/MetaEditor.php
@@ -104,6 +104,7 @@ class sspmod_metaedit_MetaEditor {
 		if (array_key_exists($key, $metadata)) {
 			$value = htmlspecialchars($metadata[$key]);
 		}
+		#echo '<tr><td><pre>'; print_r($metadata); echo '</pre></td></tr>';
 		
 		if ($textarea) {
 			return '<tr><td class="name">' . $name . '</td><td class="data">
@@ -119,7 +120,12 @@ class sspmod_metaedit_MetaEditor {
 	protected function endpointField($metadata, $key, $name, $textarea = FALSE) {
 		$value = '';
 		if (array_key_exists($key, $metadata)) {
-			$value = htmlspecialchars($metadata[$key]['Location']);
+			if (is_array($metadata[$key])) {
+				$value = htmlspecialchars($metadata[$key]['Location']);	
+			} else {
+				$value = htmlspecialchars($metadata[$key]);	
+			}
+			
 		}
 		
 		if ($textarea) {
-- 
GitLab