Commit 2e67c2ff authored by Dries's avatar Dries

- Modified patch #7958 by Adrian: store status messages in a session so they...

- Modified patch #7958 by Adrian: store status messages in a session so they can persist when redirection is used.
parent d0902316
......@@ -40,17 +40,22 @@ function drupal_get_title() {
* @{
*/
function drupal_set_message($message = NULL, $type = "status") {
static $stored_message = array();
if (!isset($_SESSION['messages'])) {
$_SESSION['messages'] = array();
}
if (isset($message)) {
$stored_message[] = array($message, $type);
$_SESSION['messages'][] = array($message, $type);
}
return $stored_message;
return $_SESSION['messages'];
}
function drupal_get_messages() {
return drupal_set_message();
$messages = drupal_set_message();
$_SESSION['messages'] = array();
return $messages;
}
/* @} */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment