diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-16 04:36:59 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-16 04:36:59 +0000 |
commit | 34da63c3e10b8f1b7a9687ce09c9cd329633248e (patch) | |
tree | 0fcaef1ca48f24e128f1ae14a80ea22fbb87c6f5 | |
parent | 5796558837cf3f579d3e69a9ac9a9237a5b33791 (diff) | |
download | pfsense-34da63c3e10b8f1b7a9687ce09c9cd329633248e.zip pfsense-34da63c3e10b8f1b7a9687ce09c9cd329633248e.tar.gz |
Return an empty array if the XMLRPC transaction is unsuccessful.
-rw-r--r-- | etc/inc/pkg-utils.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index a6386a5..bbc8e90 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -95,10 +95,14 @@ function get_pkg_info($pkgs = 'all', $info = 'all') { global $g; $params = array("pkg" => $pkgs, "info" => $info); $msg = new XML_RPC_Message('pfsense.get_pkgs', array(php_value_to_xmlrpc($params))); - $cli = new XML_RPC_Client($g['versioncheckpath'], $g['versioncheckbaseurl']); + $cli = new XML_RPC_Client($g['versioncheckpath'] . "adlkjh ", $g['versioncheckbaseurl']); $resp = $cli->send($msg, 10); - $raw_versions = $resp->value(); - return xmlrpc_value_to_php($raw_versions); + if($resp and !$resp->faultCode()) { + $raw_versions = $resp->value(); + return xmlrpc_value_to_php($raw_versions); + } else { + return array(); + } } /* |