From 64e5ab442437fcee36a733523224737b4e09f8bd Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Wed, 1 Aug 2018 10:55:13 +0200 Subject: [PATCH] HFP-1871 Fix missing variables --- h5p.classes.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 3478f23..2aeee76 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1941,12 +1941,18 @@ class H5PCore { // Get latest version of MathDisplay library $libs = $this->h5pF->loadLibraries(); $mathLibs = $libs['H5P.MathDisplay']; + + $majorMax = '0'; + $minorMax = '0'; foreach($mathLibs as $libVersion) { - if ($libVersion->major_version === $majorMax && $libVersion->minor_version > $minorMax) { + if ($libVersion->major_version === $majorMax && $libVersion->minor_version >= $minorMax) { $mathLib = $libVersion; + $minorMax = $libVersion->minor_version; } else if ($libVersion->major_version > $majorMax) { $mathLib = $libVersion; + $majorMax = $libVersion->major_version; + $minorMax = $libVersion->minor_version; } }