Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2692047
D25635.1734754122.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.1734754122.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
Sat, Dec 21, 04:08 (16 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1021065
Default Alt Text
D25635.1734754122.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