From 010720ca07eb2a3f6c828b61e247f1aeaaef503d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 23 Aug 2008 11:26:42 +0200 Subject: Be more verbose on errors in plugin manager handle "unknown" errors from TarLib and print all errors when allowdeug is set darcs-hash:20080823092642-7ad00-f2c827b422c9d49784c343804af2a0d71fb275ad.gz --- lib/plugins/plugin/admin.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/plugins/plugin/admin.php') diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index 573d8ebe3..3049d4108 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -625,6 +625,7 @@ class ap_manage { // decompress wrapper function ap_decompress($file, $target) { + global $conf; // decompression library doesn't like target folders ending in "/" if (substr($target, -1) == "/") $target = substr($target, 0, -1); @@ -642,9 +643,13 @@ class ap_manage { $tar = new TarLib($file, $compress_type); $ok = $tar->Extract(FULL_ARCHIVE, $target, '', 0777); - // FIXME sort something out for handling tar error messages meaningfully - return ($ok<0?false:true); - + if($ok<1){ + if($conf['allowdebug']){ + msg('TarLib Error: '.$tar->TarErrorStr($ok),-1); + } + return false; + } + return true; } else if ($ext == 'zip') { require_once(DOKU_INC."inc/ZipLib.class.php"); -- cgit v1.2.3