From d36b2a7b1f1b995fb75b88bd9b707218a082dc0a Mon Sep 17 00:00:00 2001 From: Nicolas Brassard Date: Wed, 18 Oct 2017 14:44:36 -0400 Subject: [PATCH] Convert string errors into array This make sure that externally defined error are properly formatted to be included in the event xml. --- lib/class.members.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/class.members.php b/lib/class.members.php index 1dd522c..1b3eace 100644 --- a/lib/class.members.php +++ b/lib/class.members.php @@ -194,6 +194,14 @@ public function appendLoginStatusToEventXML(array $context = null){ // Append error messages if(is_array(extension_Members::$_errors) && !empty(extension_Members::$_errors)) { foreach(extension_Members::$_errors as $type => $error) { + if (!is_array($error)) { + $error = array( + 'label' => $type, + 'type' => 'error', + 'message' => General::sanitize((string)$error), + 'message-id' => MemberEventMessages::MEMBER_ERRORS, + ); + } $result->appendChild( new XMLElement($type, null, array( 'label' => General::sanitize($error['label']),