From f01a0942fc6dad8e05885fccf95e4ac1dfd079c6 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Sun, 13 Mar 2005 23:25:08 +0000 Subject: * Call is_numeric() to determine whether $pkg_name is already a pkgid or if get_pkg_id() must be called. --- etc/inc/pfsense-utils.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'etc/inc/pfsense-utils.inc') diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 54948f9..3d10a0b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -864,13 +864,14 @@ if (!function_exists('php_check_syntax')){ /* * sync_package($pkg_name, $show_message) Force a package to setup its configuration and rc.d files. */ -function sync_package($pkg_name, $sync_depends = true, $pkg_id, $show_message = false) { +function sync_package($pkg_name, $sync_depends = true, $show_message = false) { global $config; if(!$config['installedpackages']['package']) return; - if($pkg_id == "") { + if(!is_numeric($pkg_name)) { $pkg_id = get_pkg_id($pkg_name); if($pkg_id == -1) return -1; // This package doesn't really exist - exit the function. } else { + $pkg_id = $pkg_name; if(!isset($config['installedpackages'][$pkg_id])) return; // No package belongs to the pkg_id passed to this function. } $package = $config['installedpackages'][$pkg_id]; -- cgit v1.1