Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version cache after successful file verification #4677

Open
dvz opened this issue Mar 3, 2023 · 0 comments
Open

Update version cache after successful file verification #4677

dvz opened this issue Mar 3, 2023 · 0 comments
Labels
b:1.9 Branch: 1.9.x s:feedback Status: Feedback. Further information/input needed t:enhancement Type: Enhancement. Contains minor improvements

Comments

@dvz
Copy link
Contributor

dvz commented Mar 3, 2023

Modify the file verification features (run manually via the ACP or, in MyBB 1.9, during installation and upgrade) to update the datacache version entry after a successful check.

Additionally, add a field to the array indicating the procedure that resulted in the latest change (installation/upgrade/verification).

Currently, the values in the version array are only updated during MyBB installation and upgrade, but not after applying MyBB updates that don't require running the upgrade script; while MyBB updates are distributed with a version bump in MyBB::$version, the value may not represent the state correctly when upgrades are in progress.

This modification will help:

  • establish the MyBB version more reliably,
  • prompt administrators to run file verification after overwrite-only MyBB updates,
  • avoid running checks similar to

    mybb/inc/init.php

    Lines 223 to 232 in f3e4d92

    // Did we just upgrade to a new version and haven't run the upgrade scripts yet?
    $version = $cache->read("version");
    if(!defined("IN_INSTALL") && !defined("IN_UPGRADE") && $version['version_code'] < $mybb->version_code)
    {
    $version_history = $cache->read("version_history");
    if(empty($version_history) || file_exists(MYBB_ROOT."inc/upgrades/upgrade".(int)(end($version_history)+1).".php"))
    {
    $mybb->trigger_generic_error("board_not_upgraded");
    }
    }
    after verification.
@dvz dvz added t:enhancement Type: Enhancement. Contains minor improvements s:feedback Status: Feedback. Further information/input needed b:1.9 Branch: 1.9.x labels Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b:1.9 Branch: 1.9.x s:feedback Status: Feedback. Further information/input needed t:enhancement Type: Enhancement. Contains minor improvements
Projects
None yet
Development

No branches or pull requests

1 participant