MDL-69475 backup: Proper handling of backup::RELEASE versions
commite881a516d00c91bfb8b094a0700fdc581239cdc4
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 18 Aug 2020 10:22:59 +0000 (18 12:22 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 18 Aug 2020 14:25:55 +0000 (18 16:25 +0200)
treef757e8f4b8e191a4fa7f5ca082306f8954f7ed00
parentcf6cdd99d419bae4139c45f5b27bc842bf2da224
MDL-69475 backup: Proper handling of backup::RELEASE versions

1) Remove any floatval() casting. They are breaking / killing
   .10 versions (converting them to .1). Since Moodle 2.0 all the
   backup::RELEASE have been 100% numerical values.
2) Use version_compare() always to compare backup::RELEASE values.
   They are always versions and the function is aware of versions
   > .9, able to clean/ignore alpha chars... and everything else.

Note that I've also changed a couple of cases in formats (topics and
weeks) that were correct, but just added the same comment and used
the same version_compare() comparison parameters style, so all uses
in core are consistent (and safe to be copied out there).
backup/moodle2/restore_stepslib.php
backup/util/dbops/restore_dbops.class.php
course/format/topics/backup/moodle2/restore_format_topics_plugin.class.php
course/format/weeks/backup/moodle2/restore_format_weeks_plugin.class.php