Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14831946
D19691.id47045.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
728 B
Referenced Files
None
Subscribers
None
D19691.id47045.diff
View Options
Index: src/filesystem/Filesystem.php
===================================================================
--- src/filesystem/Filesystem.php
+++ src/filesystem/Filesystem.php
@@ -1047,6 +1047,18 @@
return ($u == $v);
}
+ public static function concatenatePaths(array $components) {
+ $components = implode($components, DIRECTORY_SEPARATOR);
+
+ // Replace any extra sequences of directory separators with a single
+ // separator, so we don't end up with "path//to///thing.c".
+ $components = preg_replace(
+ '('.preg_quote(DIRECTORY_SEPARATOR).'{2,})',
+ DIRECTORY_SEPARATOR);
+
+ return $components;
+ }
+
/* -( Assert )------------------------------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 3:38 AM (10 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7077069
Default Alt Text
D19691.id47045.diff (728 B)
Attached To
Mode
D19691: [Wilds] Implement a Filesystem::concatenatePaths(...) method
Attached
Detach File
Event Timeline
Log In to Comment