Extra data starting at offset error showing in logs

Created on 27 May 2025, 16 days ago

Problem/Motivation

The following error keeps appearing in the logs. The issue seems to be coming from the data structure after it has been decrypted.

Steps to reproduce

Run this test

../vendor/bin/phpunit -c core ./modules/contrib/bakery/tests/src/Unit/KitchenTest.php

Example error

unserialize(): Extra data starting at offset 161 of 176 bytes

Proposed resolution

Right trim the decrypt string in function before it's unserialized

  public function decrypt(string $text): string {
    .....
    return rtrim($data, "\0");//$data; <---- replace $data with rtrim($data, "\0");
  }
🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇦🇺Australia purencool

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024