Page MenuHomePhorge

Fix a PHP 8.1 deprecated use of strlen with a NULL argument in commit parser
Needs ReviewPublic

Authored by bob on Mon, Aug 28, 13:04.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 21, 06:31
Unknown Object (File)
Sun, Sep 17, 03:01
Unknown Object (File)
Sat, Sep 16, 03:32
Unknown Object (File)
Mon, Sep 11, 22:15
Unknown Object (File)
Sun, Sep 10, 12:59
Unknown Object (File)
Sun, Sep 10, 08:37

Details

Summary

With PHP 8.1+ it is not possible to import a commit if the commiter field is not properly defined
Indeed, if the committer is not properly defined, strlen(null) is called, causing a deprecation warning, elevated to exception.
Using strlen() to check string validity is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Fix T15629

Test Plan
  • Push a commit to an observed subversion repository
  • Import it via the phorge/bin/repository reparse COMMIT_ID --importing
  • The commit should be properly imported and available in Diffusion

Diff Detail

Repository
rP Phorge
Branch
php8-fix
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 813
Build 813: arc lint + arc unit

Event Timeline

bob requested review of this revision.Mon, Aug 28, 13:04
Sten subscribed.

Looks good to me.

valerio.bozzolan retitled this revision from Fix a PHP 8.1 deprecated use of strlen with a NULL argument to Fix a PHP 8.1 deprecated use of strlen with a NULL argument in commit parser.Mon, Aug 28, 19:57