Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15345004
D7733.id17484.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7733.id17484.diff
View Options
Index: src/applications/phragment/storage/PhragmentFragment.php
===================================================================
--- src/applications/phragment/storage/PhragmentFragment.php
+++ src/applications/phragment/storage/PhragmentFragment.php
@@ -162,6 +162,34 @@
$mappings[$path] = $data;
}
+ // We need to detect any directories that are in the ZIP folder that
+ // aren't explicitly noted in the ZIP. This can happen if the file
+ // entries in the ZIP look like:
+ //
+ // * something/blah.png
+ // * something/other.png
+ // * test.png
+ //
+ // Where there is no explicit "something/" entry.
+ $directories = array();
+ foreach ($mappings as $path_key => $data) {
+ if ($data === null) {
+ $directories[] = $path_key;
+ }
+ }
+ foreach ($mappings as $path_key => $data) {
+ if ($data === null) {
+ continue;
+ }
+ $directory = dirname($path_key);
+ while ($directory !== ".") {
+ if (!in_array($directory, $directories)) {
+ $mappings[$directory] = null;
+ }
+ $directory = dirname($directory);
+ }
+ }
+
// Adjust the paths relative to this fragment so we can look existing
// fragments up in the DB.
$base_path = $this->getPath();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 8:04 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7510998
Default Alt Text
D7733.id17484.diff (1 KB)
Attached To
Mode
D7733: Implicitly detect directories when updating a fragment from a ZIP
Attached
Detach File
Event Timeline
Log In to Comment