diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 5aeb8c5b13fc9f9de62a7a35a4ddc0e5cc65c689..b8a2630fe1d09cfb70aa47d9e6c122d25efac0be 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