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 @@ -279,10 +279,11 @@ // editor links do surprising things with paths containing "/../". // Find anything that looks like "/../" and mangle it. - - $token = preg_replace('((^|/)\.\.(/|\z))', '\1dot-dot\2', $token); - - return phutil_escape_uri($token); + if (phutil_nonempty_string($token)) { + $token = preg_replace('((^|/)\.\.(/|\z))', '\1dot-dot\2', $token); + return phutil_escape_uri($token); + } + return ''; } private function newStringFromTokens(array $tokens) {