diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php index b429655708aa1..2d6a730c72add 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -249,10 +249,8 @@ public function enqueueMessage($msg, $type = self::MSG_INFO) 'type' => $inputFilter->clean(strtolower($type), 'cmd'), ]; - // For empty queue, if messages exists in the session, enqueue them first. - $messages = $this->getMessageQueue(); - - if (!\in_array($message, $this->messageQueue)) { + // Get the messages of the session and add the new message if it is not already in the queue. + if (!\in_array($message, $this->getMessageQueue())) { // Enqueue the message. $this->messageQueue[] = $message; }