From 6b3d18098acdb646d7e597c02af8d8e907003e2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Mon, 19 Jan 2009 17:27:52 +0000
Subject: [PATCH] Add new utility function arrayize()

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1164 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Utilities.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 5aeb8c5b1..b8a2630fe 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -1658,6 +1658,17 @@ class SimpleSAML_Utilities {
 		return $doc->saveXML($root);
 	}
 
+	/*
+	 * Input is single value or array, returns an array.
+	 */
+	public static function arrayize($data) {
+		if (is_array($data)) {
+			return $data;
+		} else {
+			return array($data);
+		}
+	}
+
 }
 
 ?>
\ No newline at end of file
-- 
GitLab