Skip to content

After upgrading to 5.1.0: Strings with null bytes cannot be escaped. Use the binary escape option. #1489

@ahoiroman

Description

@ahoiroman

Telescope Version

5.1.0

Laravel Version

11

PHP Version

8.3

Database Driver & Version

MariaDB

Description

After upgrading laravel/telescope to 5.1.0, I am getting a RuntimeException:

Strings with null bytes cannot be escaped. Use the binary escape option.

Bildschirmfoto 20 06 2024 - 13h 21min 06s@2x

The code that causes this is the following:

$uuid = fake()->uuid();

return Cache::remember("user-$uuid", now()->addHour(), function () {
  return User::create([
    "email" => fake()->email(),
    "password" => bcrypt(fake()->password()),
    "username" => fake()->username()
  ]);
});

The change that introduced this behavior is this: https://github.com/laravel/telescope/pull/1486/files#diff-397191004b8c1dbda4835ec7eda183402511fcb376c12796072958be5ead9f0c

Pinning telescope to 5.0.5 solves the issue for now.

Steps To Reproduce

Create a new Laravel project and use tinker(well) to run this code:

$uuid = fake()->uuid();

return Cache::remember("user-$uuid", now()->addHour(), function () {
  return User::create([
    "email" => fake()->email(),
    "password" => bcrypt(fake()->password()),
    "username" => fake()->username()
  ]);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions