diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-19 17:18:01 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-19 17:18:01 -0700 |
commit | a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14 (patch) | |
tree | 4d67f4896aaf60c76ac69b8507fcc1b44028d2de /mod/import.php | |
parent | e85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5 (diff) | |
download | volse-hubzilla-a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14.tar.gz volse-hubzilla-a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14.tar.bz2 volse-hubzilla-a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14.zip |
automatically gunzip Diaspora export files if we're on a *nix system
Diffstat (limited to 'mod/import.php')
-rw-r--r-- | mod/import.php | 9 |
1 files changed, 9 insertions, 0 deletions
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); } |