1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-08 13:51:02 +01:00
phorge-phorge/src/applications/macro
Andre Klapper b4cfe56f03 Fix PHP 8.1 "ltrim(null)" exception which blocks rendering first Meme comment
Summary:
Since PHP 8.1, passing a null string to `ltrim(string $string)` is deprecated.

Thus first check if After and Below text are not null before trimming.

Closes T15379

Test Plan:
Applied this change; afterwards several times created a new Pholio mock and added a Meme comment. I could not reproduce the problem anymore (first meme comment in a mock always rendered correctly instead of showing an exception as comment). However, I could not reliably reproduce the problem anyway.

- Create a meme without any above/below text
- Create a meme with just spaces as above/below text
- Create a meme with just above text as "asd", or "0" or a lizard
- Create a meme with just below text as "asd", or "0" or a lizard
- Create a meme with both above and below texts with "asd", "0" and a lizard and more stuff (doing all 64 combinations)

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15379

Differential Revision: https://we.phorge.it/D25212
2023-06-10 18:41:00 +02:00
..
application Update Macro comment form 2017-05-03 12:34:21 -07:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
conduit PhabricatorMemeEngine HA HA HA HA 2018-03-08 11:06:52 -08:00
controller Improve timeline rendering for old macros 2019-04-18 18:25:17 -07:00
editor Remove "metamta.*.subject-prefix" options 2019-01-17 19:18:50 -08:00
engine Fix PHP 8.1 "ltrim(null)" exception which blocks rendering first Meme comment 2023-06-10 18:41:00 +02:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
markup Possibly fix memes in email 2018-03-08 11:09:21 -08:00
phid Provide an application link for the Macro PHID type 2015-10-24 09:41:13 -07:00
query Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
storage Remove "getApplicationTransactionObject()" from ApplicationTransactionInterface 2018-12-20 15:16:19 -08:00
typeahead Add some sort of sort to Emoji Autocomplete 2017-01-24 20:21:06 -08:00
xaction Remove "PhabricatorFile->detachFromObject()" 2022-05-19 13:21:03 -07:00