View Issue Details

IDProjectCategoryView StatusLast Update
0037369mantisbtbugtrackerpublic2026-09-06 06:40
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.20.0 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037369: helper_parse_id() throws PHP warning when $p_id parameter is null (PHP 8.1)
Description

The function's PHPDoc states that $p_id parameter should be a string, but in fact it can also be null (and possibly other types as well).

When this happens, PHP throws
DEPRECATED: trim(): Passing null to parameter 0000001 ($string) of type string is deprecated.

Additional Information

Regression introduced by MantisBT master c20e9622 / PHP 8.1

TagsPHP 8.1

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master f72443f3

2026-09-05 09:51

dregad


Details Diff
Fix PHP deprecation warning in helper_parse_id()

PHPDoc states that $p_id should be a string, but in fact it can also be
null (and possibly other types as well).

Changing the PHPDoc type to mixed, and refactor the code to ensure we
don't get DEPRECATED: trim(): Passing null to parameter 0000001 ($string) of
type string is deprecated.

Fixes 0037369
Affected Issues
0037369
mod - core/helper_api.php Diff File