Page MenuHomePhorge

D25324.1731626231.diff
No OneTemporary

D25324.1731626231.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
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)

Event Timeline