From 9314c55994783c58bfb023d23954102bae0cfed9 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Thu, 26 Jul 2018 19:34:46 +0200 Subject: [PATCH] HFP-1871 Clean code --- h5p.classes.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index f56a284..78d6d06 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1938,10 +1938,8 @@ class H5PCore { } $validator->validateLibrary($params, (object) array('options' => array($params->library))); - // Add latest MathDisplay version if content contains math - $libs = $this->h5pF->loadLibraries(); - // Get latest version of MathDisplay library + $libs = $this->h5pF->loadLibraries(); $mathLibs = $libs['H5P.MathDisplay']; foreach($mathLibs as $libVersion) { if ($libVersion->major_version === $majorMax && $libVersion->minor_version > $minorMax) { @@ -1952,6 +1950,7 @@ class H5PCore { } } + // Add latest MathDisplay version if content contains math if (isset($mathLib)) { // Retrieve regular expression from library.json // Careful: \ will have to be escaped itself inside json