Page MenuHomePhorge

D25324.1734733102.diff
No OneTemporary

D25324.1734733102.diff

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

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)

Event Timeline