Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2618956
D25324.1731626231.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.1731626231.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
Thu, Nov 14, 23:17 (6 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
970712
Default Alt Text
D25324.1731626231.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