Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15333638
D19691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
703 B
Referenced Files
None
Subscribers
None
D19691.diff
View Options
diff --git a/src/filesystem/Filesystem.php b/src/filesystem/Filesystem.php
--- a/src/filesystem/Filesystem.php
+++ b/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
Sun, Mar 9, 3:39 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309524
Default Alt Text
D19691.diff (703 B)
Attached To
Mode
D19691: [Wilds] Implement a Filesystem::concatenatePaths(...) method
Attached
Detach File
Event Timeline
Log In to Comment