Skip to content

Request::isMethod fails when Request::$method is null #344

@NTSFka

Description

@NTSFka

Version: 3.2.6 (PHP 8.2)

Bug Description

Method Request::isMethod raises an error when Request:$method is null. Same bug was already fixed but it was introduced in commit 9c288cc.

Steps To Reproduce

$request = new \Nette\Application\Request('test', method: null);

// PHP Fatal error:  Uncaught TypeError: strcasecmp(): Argument #1 ($string1) must be of type string, null given in vendor/nette/application/src/Application/Request.php:161
echo $request->isMethod('GET') ? 'TRUE' : 'FALSE';

Expected Behavior

No error is raised.

Possible Solution

Rollback change in Request introduced in 9c288cc.

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