From a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 19 Jun 2015 17:18:01 -0700 Subject: automatically gunzip Diaspora export files if we're on a *nix system --- mod/import.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mod') diff --git a/mod/import.php b/mod/import.php index 4542ef7a0..02f4133d5 100644 --- a/mod/import.php +++ b/mod/import.php @@ -38,6 +38,15 @@ function import_post(&$a) { if($src) { + + // This is OS specific and could also fail if your tmpdir isn't very large + // mostly used for Diaspora which exports gzipped files. + + if(strpos($filename,'.gz')){ + @rename($src,$src . '.gz'); + @system('gunzip ' . escapeshellarg($src . '.gz')); + } + if($filesize) { $data = @file_get_contents($src); } -- cgit v1.2.3