Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2689372
D25324.1734733102.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25324.1734733102.diff
View Options
diff --git a/src/infrastructure/editor/PhabricatorEditorURIEngine.php b/src/infrastructure/editor/PhabricatorEditorURIEngine.php
--- a/src/infrastructure/editor/PhabricatorEditorURIEngine.php
+++ b/src/infrastructure/editor/PhabricatorEditorURIEngine.php
@@ -16,7 +16,7 @@
$pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY);
- if (!strlen(trim($pattern))) {
+ if ($pattern === null || trim($pattern) === '') {
return null;
}
diff --git a/src/infrastructure/editor/__tests__/PhabricatorEditorURIEngineTestCase.php b/src/infrastructure/editor/__tests__/PhabricatorEditorURIEngineTestCase.php
--- a/src/infrastructure/editor/__tests__/PhabricatorEditorURIEngineTestCase.php
+++ b/src/infrastructure/editor/__tests__/PhabricatorEditorURIEngineTestCase.php
@@ -3,6 +3,12 @@
final class PhabricatorEditorURIEngineTestCase
extends PhabricatorTestCase {
+ protected function getPhabricatorTestCaseConfiguration() {
+ return array(
+ self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
+ );
+ }
+
public function testPatternParsing() {
$map = array(
'' => array(),
@@ -129,4 +135,15 @@
}
}
+ public function testNewForViewer() {
+ $phabricator_user = $this->generateNewTestUser();
+ try {
+ $engine = PhabricatorEditorURIEngine::newForViewer($phabricator_user);
+ $this->assertTrue(true, 'newForViewer did not throw an error');
+ } catch (Throwable $ex) {
+ $this->assertTrue(false,
+ 'newForViewer threw an exception:'.$ex->getMessage());
+ }
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 22:18 (14 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016372
Default Alt Text
D25324.1734733102.diff (1 KB)
Attached To
Mode
D25324: Fix PHP 8.1 PhabricatorEditorURIEngine::newForViewer() trim(NULL) error
Attached
Detach File
Event Timeline
Log In to Comment