Page MenuHomePhorge

Fix "Undefined index" exception setting Meme text
Needs ReviewPublic

Authored by aklapper on Sat, Sep 16, 12:14.
Tags
None
Referenced Files
F357858: D25437.diff
Mon, Sep 25, 02:38
Unknown Object (File)
Thu, Sep 21, 08:02
Unknown Object (File)
Thu, Sep 21, 06:29
Unknown Object (File)
Thu, Sep 21, 00:30

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Maniphest Tasks
T15637: Undefined index exception setting Meme text
Summary

strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

EXCEPTION: (RuntimeException) Undefined index: above at [<arcanist>/src/error/PhutilErrorHandler.php:251]
 arcanist(), phorge()
   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phorge>/src/applications/macro/engine/PhabricatorMemeEngine.php:276]

Closes T15637

Test Plan

Carefully read the code, keeping in mind that strlen does not accept passing null in PHP 8, and looking at what we did in rPb4cfe56f03b44615ac9251aed8d74bf13b085051.

Diff Detail

Repository
rP Phorge
Branch
memeTextNull (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 843
Build 843: arc lint + arc unit