MDL-67743 table: Sort direction is an integer
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 27 May 2020 03:16:22 +0000 (11:16 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 27 May 2020 03:16:24 +0000 (11:16 +0800)
lib/tablelib.php

index 79052b3..8e28ab4 100644 (file)
@@ -1503,7 +1503,7 @@ class flexible_table {
         $this->sortdata = [];
         foreach ($sortdata as $sortitem) {
             if (!array_key_exists($sortitem['sortby'], $this->sortdata)) {
-                $this->sortdata[$sortitem['sortby']] = $sortitem['sortorder'];
+                $this->sortdata[$sortitem['sortby']] = (int) $sortitem['sortorder'];
             }
         }
     }