From 2e67c2ffa1e4db433978342ce10fbac0a30dee12 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 22 May 2004 22:21:49 +0000 Subject: [PATCH] - Modified patch #7958 by Adrian: store status messages in a session so they can persist when redirection is used. --- includes/common.inc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index 95cac35dcd6..5da3bda2c03 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -40,17 +40,22 @@ function drupal_get_title() { * @{ */ function drupal_set_message($message = NULL, $type = "status") { - static $stored_message = array(); - - if (isset($message)) { - $stored_message[] = array($message, $type); + if (!isset($_SESSION['messages'])) { + $_SESSION['messages'] = array(); } - return $stored_message; + if (isset($message)) { + $_SESSION['messages'][] = array($message, $type); + } + + return $_SESSION['messages']; } function drupal_get_messages() { - return drupal_set_message(); + $messages = drupal_set_message(); + $_SESSION['messages'] = array(); + + return $messages; } /* @} */