Skip to content

[3.0] Compare saved document hashes when detecting rollbacks - #9901

Open
mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9854-registration-history-rollback
Open

mattago93 wants to merge 1 commit into
SimpleMachines:release-3.0from
mattago93:fix-9854-registration-history-rollback

Conversation

@mattago93

Copy link
Copy Markdown

Fixes the use of an uninitialized $diff variable when detecting rollbacks in the registration agreement and privacy policy edit histories.

EditDiff::label1 is the CRC32C hash of the new document text. The rollback checks now calculate that hash directly from the submitted agreement or privacy policy instead of accessing an object that has not yet been initialized.

The change is limited to two comparisons in Sources/Actions/Admin/Registration.php.

Verification:

  • Confirmed that matching a previous version's hash detects a rollback.
  • Confirmed that a different hash selects the combine path.
  • Full SMF integration tests and Composer lint have not been run.

Issues References (Fixes|Related|Closes)

Fixes #9854

Use the hash of the newly submitted agreement or privacy policy to
recognize a rollback instead of reading an uninitialized EditDiff.

Fixes SimpleMachines#9854

Signed-off-by: Mattia Agostini <agostini.19@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.0] Use of unassigned variable '$diff'

1 participant