From: Janusz Dobrowolski Date: Sun, 8 Apr 2012 17:22:36 +0000 (+0200) Subject: Fixed system tests and error handling for extension repository functions. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=ccb41afddc9ba11d792c17729b1ef022f888aa31;p=textcart.git Fixed system tests and error handling for extension repository functions. --- diff --git a/includes/packages.inc b/includes/packages.inc index bb7a096..e3c55e2 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -288,7 +288,7 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey $sig = url_get_contents(REPO_URL.'/Release.sig'); $data = file_get_contents($loclist); $cert = file_get_contents(PUBKEY_PATH.'/FA.pem'); - if (!openssl_verify($data, $sig, $cert)) { + if (openssl_verify($data, $sig, $cert) <= 0) { if ($refresh) { if (!@unlink($loclist)) { diff --git a/includes/system_tests.inc b/includes/system_tests.inc index 710178e..0729ec4 100644 --- a/includes/system_tests.inc +++ b/includes/system_tests.inc @@ -359,9 +359,18 @@ function tst_extconfig($install) $test['result'] &= $t; } + foreach(array('Release', 'Themes', 'Languages', 'Extensions', 'Charts') as $file) { + $fname = $path_to_root."/modules/_cache/".$file.".gz"; + $t = !file_exists($fname) || is_writable($fname); + if (!$t) + $test['comments'][] = sprintf(_("'%s' is not writeable"), $fname); + $test['result'] &= $t; + } + if(!$test['result']) $test['comments'][] = _("Extensions configuration files and directories should be writeable"); + $fname = $path_to_root."/themes"; $themedir = opendir($fname); while (false !== ($fname = readdir($themedir))) {