summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-04-04 20:50:53 +0000
committerDries Buytaert <dries@buytaert.net>2007-04-04 20:50:53 +0000
commit8fd0fdbd54e17e176959592d9ee43e3b3ba60f97 (patch)
treec7cb92d0e4aeba1b2ee0f3abf47be8f4947407b8 /includes
parentbb9f9a33e4fe83f4d9f8ae88c15b8b1df6d029f2 (diff)
downloadbrdo-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.inc9
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) {