Skip to content

Image dispatcher loads wrong function signatures on PHP 8.3 #735

Description

@acabal

Consider the dispatcher for image functions:

if (str_starts_with(PHP_VERSION, "8.3.")) {
require_once __DIR__ . '/8.2/image.php';
}

If a machine is running PHP 8.3, the dispatcher loads the PHP 8.2 signatures for image functions.

However this is incorrect for imagerotate(). In PHP <= 8.2, imagerotate() accepts 4 arguments, but in PHP >= 8.3 it accepts 3 arguments. Therefore, on a machine running PHP 8.3, Safe loads 8.2's old signatures and passes the function 4 arguments when it only accepts 3, causing breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions