summaryrefslogtreecommitdiff
path: root/includes/bootstrap.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r--includes/bootstrap.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index ad750be6d..caf23b672 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -751,8 +751,11 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
* - 'status'
* - 'warning'
* - 'error'
+ * @param $repeat
+ * If this is FALSE and the message is already set, then the message won't
+ * be repeated.
*/
-function drupal_set_message($message = NULL, $type = 'status') {
+function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
if ($message) {
if (!isset($_SESSION['messages'])) {
$_SESSION['messages'] = array();
@@ -762,7 +765,9 @@ function drupal_set_message($message = NULL, $type = 'status') {
$_SESSION['messages'][$type] = array();
}
- $_SESSION['messages'][$type][] = $message;
+ if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
+ $_SESSION['messages'][$type][] = $message;
+ }
}
// messages not set when DB connection fails