mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
fix: make Ajax::$action
property nullable to handle missing POST parameter
## Problem When calling ajax.php without passing the 'action' parameter, PHP throws a TypeError: `Cannot assign null to property TorrentPier\Ajax::$action of type string` ## Solution Changed the `$action` property type from `string` to `?string` to allow null values when the POST parameter is not provided. ## Changes - Changed `public string $action;` to `public ?string $action;`
This commit is contained in:
parent
57a9f3f7c6
commit
0bcce449c1
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ class Ajax
|
|||
'index_data' => ['guest'],
|
||||
];
|
||||
|
||||
public string $action;
|
||||
public ?string $action;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue