Skip to content
Snippets Groups Projects
Commit e96dc96a authored by Thomas Marstrander's avatar Thomas Marstrander
Browse files

Fix not using LIMIT to support dbs where it is not valid syntax

parent 65f966e8
Branches
Tags
No related merge requests found
...@@ -1597,19 +1597,22 @@ class framework implements \H5PFrameworkInterface { ...@@ -1597,19 +1597,22 @@ class framework implements \H5PFrameworkInterface {
public function libraryHasUpgrade($library) { public function libraryHasUpgrade($library) {
global $DB; global $DB;
return !!$DB->get_field_sql( $results = $DB->get_records_sql(
"SELECT id "SELECT id
FROM {hvp_libraries} FROM {hvp_libraries}
WHERE machine_name = ? WHERE machine_name = ?
AND (major_version > ? AND (major_version > ?
OR (major_version = ? AND minor_version > ?)) OR (major_version = ? AND minor_version > ?))",
LIMIT 1",
array( array(
$library['machineName'], $library['machineName'],
$library['majorVersion'], $library['majorVersion'],
$library['majorVersion'], $library['majorVersion'],
$library['minorVersion'] $library['minorVersion']
) ),
0,
1
); );
return !empty($results);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment