From d47289622650137dd1a4cc7d6deafa54fcc340ee Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 4 May 2023 13:13:43 +0200 Subject: [PATCH] Fix PHP 8.1 "rawurlencode(null)" exception which blocks rendering a project page Summary: After PHP 8.1 the function `rawurlencode()` does not accept anymore the `null` value. Thus return an empty string when the input parameter is null instead of passing the input parameter to `rawurlencode()`. Closes T15263 Test Plan: Applied this change on top of D25144, D25145, D25146, D25147, D25151, D25152, D25153 and D25163 and already existing Workboard located at `/project/view/1/` finally rendered in web browser. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15263 Differential Revision: https://we.phorge.it/D25164 --- src/utils/utils.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/utils.php b/src/utils/utils.php index 3bcaab02..37466bc6 100644 --- a/src/utils/utils.php +++ b/src/utils/utils.php @@ -1888,6 +1888,9 @@ function phutil_is_natural_list(array $list) { * @return string URI encoded string, except for '/'. */ function phutil_escape_uri($string) { + if ($string === null) { + return ''; + } return str_replace('%2F', '/', rawurlencode($string)); }