diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-04-04 20:50:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-04-04 20:50:53 +0000 |
commit | 8fd0fdbd54e17e176959592d9ee43e3b3ba60f97 (patch) | |
tree | c7cb92d0e4aeba1b2ee0f3abf47be8f4947407b8 /includes | |
parent | bb9f9a33e4fe83f4d9f8ae88c15b8b1df6d029f2 (diff) | |
download | brdo-8fd0fdbd54e17e176959592d9ee43e3b3ba60f97.tar.gz brdo-8fd0fdbd54e17e176959592d9ee43e3b3ba60f97.tar.bz2 |
- Modified patch #133318 by hunmonk: drupal_get_messages() returning incorrect array value.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 994763fb3..adece9912 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -709,6 +709,11 @@ function drupal_set_message($message = NULL, $type = 'status') { * (optional) Only return messages of this type. * @param $clear_queue * (optional) Set to FALSE if you do not want to clear the messages queue + * @return + * An associative array, the key is the message type, the value an array + * of messages. If the $type parameter is passed, you get only that type, + * or an empty array if there are no such messages. If $type is not passed, + * all message types are returned, or an empty array if none exist. */ function drupal_get_messages($type = NULL, $clear_queue = TRUE) { if ($messages = drupal_set_message()) { @@ -716,7 +721,9 @@ function drupal_get_messages($type = NULL, $clear_queue = TRUE) { if ($clear_queue) { unset($_SESSION['messages'][$type]); } - return array($type => $messages[$type]); + if (isset($messages[$type])) { + return array($type => $messages[$type]); + } } else { if ($clear_queue) { |