From 8af16246920c5fec42035bdd43a571ca20719f59 Mon Sep 17 00:00:00 2001 From: Steve Campbell Date: Mon, 17 Jul 2023 11:05:03 +0100 Subject: [PATCH] Fix passing null to trim() error in DiffusionBrowseTableView render() Summary: When viewing the top level of a diffusion repository, $request->getPath() returns null, which then causes trim() to throw an error. Fix is to update DiffusionRequest getPath() such that it returns '' instead of null, thus fixing it's return type. Fixes T15522 Test Plan: Go to https://my.phorge.site/source/myrepo Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15522 Differential Revision: https://we.phorge.it/D25329 --- src/applications/diffusion/request/DiffusionRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index 4bcb4d3bc5..c301b89b28 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -254,7 +254,7 @@ abstract class DiffusionRequest extends Phobject { } public function getPath() { - return $this->path; + return coalesce($this->path, ''); } public function getLine() {