Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2689155
D25635.1734729143.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
772 B
Referenced Files
None
Subscribers
None
D25635.1734729143.diff
View Options
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) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 21:12 (16 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1021065
Default Alt Text
D25635.1734729143.diff (772 B)
Attached To
Mode
D25635: Fix PHP 8.1 "preg_replace(null)" exception in PhabricatorEditorURIEngine.php
Attached
Detach File
Event Timeline
Log In to Comment