diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-04 02:16:05 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-04 02:16:05 +0000 |
commit | 82ed2fe0bea0c12f19b261e0e1cf8ad9cb2ba668 (patch) | |
tree | bbff46a3f6a32ba1306ea54ac779ef834882e8d4 /engine/lib/views.php | |
parent | 3c4416543fafa1d0e6fee05fff9c6abcd73c7763 (diff) | |
download | elgg-82ed2fe0bea0c12f19b261e0e1cf8ad9cb2ba668.tar.gz elgg-82ed2fe0bea0c12f19b261e0e1cf8ad9cb2ba668.tar.bz2 |
check if there are any messages before grabbing them in elgg_view_page()
git-svn-id: http://code.elgg.org/elgg/trunk@7523 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r-- | engine/lib/views.php | 18 |
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; |