diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index 6c94fcc6..066bf5a9 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -665,7 +665,7 @@ class Code extends Controller if ($file === FALSE) { $data['project'] = $project; - $data['message'] = "Failed to get a file - $path"; + $data['message'] = "Failed to get a file"; $this->load->view ($this->VIEW_ERROR, $data); } else if ($file['type'] == 'file') @@ -700,7 +700,7 @@ class Code extends Controller if ($filename === FALSE) { $data['project'] = $project; - $data['message'] = "Failed to zip a directory for $path"; + $data['message'] = "Failed to zip a directory"; $this->load->view ($this->VIEW_ERROR, $data); } else diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index c959079f..203d7d7a 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -1002,6 +1002,11 @@ class SubversionModel extends Model function zipSubdir ($projectid, $path, $rev, $topdir) { + // codepot_zip_dir() uses ZipArchive. Check if the class + // exists not to perform any intermediate steps when it's + // not available. + if (!class_exists('ZipArchive')) return FALSE; + $orgurl = 'file://'.$this->_canonical_path(CODEPOT_SVNREPO_DIR."/{$projectid}/{$path}"); $workurl = ($path == '')? $orgurl: "{$orgurl}@"; // trailing @ for collision prevention @@ -1050,7 +1055,9 @@ class SubversionModel extends Model return FALSE; } - //codepot_delete_files ($actual_tfname, TRUE); // delete the directory in case it exists + // temporary files are not deleted here. + // the caller must clear temporary files. + return $tfname; } }