diff --git a/admin/purgecaches.php b/admin/purgecaches.php index b4401c4c26265..b43aa7777a2d6 100644 --- a/admin/purgecaches.php +++ b/admin/purgecaches.php @@ -52,8 +52,14 @@ $message = get_string('purgecachesfinished', 'admin'); } +// Redirect and/or show notification message confirming cache(s) were purged. if (isset($message)) { - redirect($returnurl, $message); + if (!$PAGE->url->compare($returnurl, URL_MATCH_BASE)) { + redirect($returnurl, $message); + } + + // We are already on the purge caches page, add the notification. + \core\notification::add($message, \core\output\notification::NOTIFY_INFO); } // Otherwise, show a form to actually purge the caches.