Permalink
Browse files

MDL-26625 do not look for session size if session not started

  • Loading branch information...
1 parent 23c7994 commit ed66022935843752b78fbfbc6db6e3839864c039 @skodak skodak committed Mar 8, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/moodlelib.php
View
10 lib/moodlelib.php
@@ -9300,10 +9300,12 @@ function get_performance_info() {
$info['txt'] .= "serverload: {$info['serverload']} ";
}
- // Display size of session
- $info['sessionsize'] = display_size(strlen(session_encode()));
- $info['html'] .= '<span class="sessionsize">Session: ' . $info['sessionsize'] . '</span> ';
- $info['txt'] .= "Session: {$info['sessionsize']} ";
+ // Display size of session if session started
+ if (session_id()) {
+ $info['sessionsize'] = display_size(strlen(session_encode()));
+ $info['html'] .= '<span class="sessionsize">Session: ' . $info['sessionsize'] . '</span> ';
+ $info['txt'] .= "Session: {$info['sessionsize']} ";
+ }
/* if (isset($rcache->hits) && isset($rcache->misses)) {
$info['rcachehits'] = $rcache->hits;

0 comments on commit ed66022

Please sign in to comment.