Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit ed66022935843752b78fbfbc6db6e3839864c039 1 parent 23c7994
Petr Skoda skodak authored

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. +6 4 lib/moodlelib.php
10 lib/moodlelib.php
@@ -9300,10 +9300,12 @@ function get_performance_info() {
9300 9300 $info['txt'] .= "serverload: {$info['serverload']} ";
9301 9301 }
9302 9302
9303   - // Display size of session
9304   - $info['sessionsize'] = display_size(strlen(session_encode()));
9305   - $info['html'] .= '<span class="sessionsize">Session: ' . $info['sessionsize'] . '</span> ';
9306   - $info['txt'] .= "Session: {$info['sessionsize']} ";
  9303 + // Display size of session if session started
  9304 + if (session_id()) {
  9305 + $info['sessionsize'] = display_size(strlen(session_encode()));
  9306 + $info['html'] .= '<span class="sessionsize">Session: ' . $info['sessionsize'] . '</span> ';
  9307 + $info['txt'] .= "Session: {$info['sessionsize']} ";
  9308 + }
9307 9309
9308 9310 /* if (isset($rcache->hits) && isset($rcache->misses)) {
9309 9311 $info['rcachehits'] = $rcache->hits;

0 comments on commit ed66022

Please sign in to comment.
Something went wrong with that request. Please try again.