Differential D25160 Diff 607 src/applications/settings/panel/PhabricatorExternalEditorSettingsPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorExternalEditorSettingsPanel.php
Show All 33 Lines | public function newSettingsPanelEditFormHeadContent( | ||||
if ($state->getIsSubmit()) { | if ($state->getIsSubmit()) { | ||||
return null; | return null; | ||||
} | } | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY); | $pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY); | ||||
if (!strlen($pattern)) { | if (!phutil_nonempty_string($pattern)) { | ||||
valerio.bozzolan: ✅ I tested this locally with `phlog()` and it seems the valid input domain of `$pattern` is… | |||||
return null; | return null; | ||||
} | } | ||||
$caught = null; | $caught = null; | ||||
try { | try { | ||||
id(new PhabricatorEditorURIEngine()) | id(new PhabricatorEditorURIEngine()) | ||||
->setPattern($pattern) | ->setPattern($pattern) | ||||
->validatePattern(); | ->validatePattern(); | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I tested this locally with phlog() and it seems the valid input domain of $pattern is just string - with values like "txmt://open/?url=file:///Users/alincoln/editor_links/%n/%f&line=%l", or a default to null.
The phutil_nonempty_string() will report alien types, and that is OK.