Avatar

Message for upgradeable version in the admin panel (Technics)

by Milo ⌂, Tuesday, April 17, 2018, 19:40 (187 days ago) @ Auge

Hi,

I start a test on my local WAMP installation. All three implementations in getExternalResource($url) works fine and return the feed content - ignore my comment.

I analysed the function and I believe, I found the reason of the problem. The critical line is:

if ($lastVersion != $currentVersion && $updateDateOfActualVersion > $updateDateOfInstalledVersion) {

$currentVersion contains the current installed version of the software and $lastVersion contains the last available version on github. If the forum is updated before the daily schedule was run, the if-condition fails (because of '2.4.9' != '2.4.9' --> false). The same problems exists on the condition of $updateDateOfActualVersion and $updateDateOfInstalledVersion. Whereas $updateDateOfActualVersion contains the date of the last available version on github, $updateDateOfActualVersion contains the date of installed version - taken from the feed, too. This condition also return false, if the forum is updated before the daily schedule was run.

We should remove the condition or using a further function argument, that contains the last version of the 'temp_infos' table (in addition to the installed version number). If we remove the condition, a sql update runs every day, i.e. the following code is executed

if ($latestRelease !== false) {
    @mysqli_query($connid, "INSERT INTO ".$db_settings['temp_infos_table']." (`name`, `value`, `time`) VALUES ('last_version_check', '" . mysqli_real_escape_string($connid, $latestRelease->version) . "', NOW()) ON DUPLICATE KEY UPDATE `value` = '" . mysqli_real_escape_string($connid, $latestRelease->version) . "', `time` = NOW();");
    @mysqli_query($connid, "INSERT INTO ".$db_settings['temp_infos_table']." (`name`, `value`) VALUES ('last_version_uri', '" . mysqli_real_escape_string($connid, $latestRelease->uri) . "') ON DUPLICATE KEY UPDATE `value` = '" . mysqli_real_escape_string($connid, $latestRelease->uri) . "';");
   }

In my opinion, it is a reasonable change.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


Complete thread:

 RSS Feed of thread

powered by my little forum