summaryrefslogtreecommitdiff
path: root/includes/bootstrap.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r--includes/bootstrap.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 968f0d29f..7a4518a51 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -261,12 +261,16 @@ function watchdog($type, $message, $link = NULL) {
* @{
*/
function drupal_set_message($message = NULL, $type = "status") {
- if (!isset($_SESSION['messages'])) {
- $_SESSION['messages'] = array();
- }
-
if (isset($message)) {
- $_SESSION['messages'][] = array($message, $type);
+ if (!isset($_SESSION['messages'])) {
+ $_SESSION['messages'] = array();
+ }
+
+ if (!isset($_SESSION['messages'][$type])) {
+ $_SESSION['messages'][$type] = array();
+ }
+
+ $_SESSION['messages'][$type][] = $message;
}
return $_SESSION['messages'];