From 1275326ea6b6ce16ed2ebda895cc8cd0849f242d Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 11 Feb 2019 09:58:38 -0800 Subject: [PATCH] Use "phutil_string_cast()" in TypeaheadDatasource Summary: Depends on D20138. Ref T13250. This improves exception behavior and gives us a standard page with a stack trace instead of a text fatal with no stack trace. Truly a great day for PHP. (Eventually we may want to replace all `(string)` with `phutil_string_cast()`, but let's let it have some time in the wild first?) Test Plan: Triggered the error, got a more useful exception behavior. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13250 Differential Revision: https://secure.phabricator.com/D20140 --- .../typeahead/datasource/PhabricatorTypeaheadDatasource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php index 196ad1b98b..43cc72eaaa 100644 --- a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php +++ b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php @@ -101,7 +101,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject { public function getDatasourceURI() { $uri = new PhutilURI('/typeahead/class/'.get_class($this).'/'); $uri->setQueryParams($this->newURIParameters()); - return (string)$uri; + return phutil_string_cast($uri); } public function getBrowseURI() { @@ -111,7 +111,7 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject { $uri = new PhutilURI('/typeahead/browse/'.get_class($this).'/'); $uri->setQueryParams($this->newURIParameters()); - return (string)$uri; + return phutil_string_cast($uri); } private function newURIParameters() {