aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 3385e230c..09653e11d 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1308,15 +1308,17 @@ function autoregister_views($view_base, $folder, $base_location_path, $viewtype)
* @since 1.8
*/
function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) {
- // get messages - try for errors first
- $sysmessages = system_messages(NULL, "errors");
- if (count($sysmessages["errors"]) == 0) {
- // no errors so grab rest of messages
- $sysmessages = system_messages(null, "");
- } else {
- // we have errors - clear out remaining messages
- system_messages(null, "");
+ if (count_messages()) {
+ // get messages - try for errors first
+ $sysmessages = system_messages(NULL, "errors");
+ if (count($sysmessages["errors"]) == 0) {
+ // no errors so grab rest of messages
+ $sysmessages = system_messages(null, "");
+ } else {
+ // we have errors - clear out remaining messages
+ system_messages(null, "");
+ }
}
$vars['title'] = $title;