View Issue Details

IDProjectCategoryView StatusLast Update
0032809mantisbtbugtrackerpublic2023-10-14 12:28
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.25.8Fixed in Version2.25.8 
Summary0032809: PHP 8.1 deprecation notice in user_search_cache()
Description

PHPUnit test case LoginTest::testLoginWithNullPasswordIsRejected fails on PHP 8.1 due to error:
strcmp(): Passing null to parameter 2 ($string2) of type string is deprecated.

TagsPHP 8.1

Activities

atrol

atrol

2023-08-08 03:17

developer   ~0067974

Last edited: 2023-08-08 03:18

@dregad we do still support PHP 5.5 in master-2.25. The null coalescing operator can't be used, as it was introduced with PHP 7.0.

$t_value = $p_value ?? '';
dregad

dregad

2023-08-08 03:20

developer   ~0067975

Damn, I keep forgetting :-(

atrol

atrol

2023-08-08 03:21

developer   ~0067976

Time to get out 2.26.0 ...

dregad

dregad

2023-08-08 07:22

developer   ~0067977

Yes indeed... I've actually been working on that for the past couple weeks since I came back from vacation :-)

Related Changesets

MantisBT: master-2.25 a1b5eae8

2023-08-07 19:54

dregad


Details Diff
Fix deprecated notice in user_search_cache()

PHPUnit test case LoginTest::testLoginWithNullPasswordIsRejected fails
on PHP 8.1 due to error: "strcmp(): Passing null to parameter 0000002
($string2) of type string is deprecated".

When $p_value is null, convert it to empty string before calling
strcmp/strcasecmp.

Fixes 0032809
Affected Issues
0032809
mod - core/user_api.php Diff File

MantisBT: master-2.25 519b5b63

2023-08-08 03:32

dregad


Details Diff
Remove null-coalescing operator

Not supported in PHP 5.x.

Fixes 0032809, follow-up on a1b5eae881a5675dcd78b2d7a0d03371b2228d79.
Affected Issues
0032809
mod - core/user_api.php Diff File