Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/editor/PhabricatorEditorURIEngine.php
Show All 10 Lines | final class PhabricatorEditorURIEngine | ||||
public static function newForViewer(PhabricatorUser $viewer) { | public static function newForViewer(PhabricatorUser $viewer) { | ||||
if (!$viewer->isLoggedIn()) { | if (!$viewer->isLoggedIn()) { | ||||
return null; | return null; | ||||
} | } | ||||
$pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY); | $pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY); | ||||
if (!strlen(trim($pattern))) { | if ($pattern === null || !strlen(trim($pattern))) { | ||||
return null; | return null; | ||||
} | } | ||||
$engine = id(new self()) | $engine = id(new self()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setPattern($pattern); | ->setPattern($pattern); | ||||
// If there's a problem with the pattern, | // If there's a problem with the pattern, | ||||
▲ Show 20 Lines • Show All 339 Lines • Show Last 20 Lines |