From 080783a99eb5016d810942c9a064073292c24499 Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 6 Sep 2023 19:39:25 -0600 Subject: [PATCH 1/3] fix: use version_compare for api update checks #390 --- .../files/etc/inc/api/models/APISystemAPIVersionRead.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pfSense-pkg-API/files/etc/inc/api/models/APISystemAPIVersionRead.inc b/pfSense-pkg-API/files/etc/inc/api/models/APISystemAPIVersionRead.inc index 7ef90b22d..2d89dc3ad 100644 --- a/pfSense-pkg-API/files/etc/inc/api/models/APISystemAPIVersionRead.inc +++ b/pfSense-pkg-API/files/etc/inc/api/models/APISystemAPIVersionRead.inc @@ -66,10 +66,7 @@ class APISystemAPIVersionRead extends APIModel { } public static function is_update_available() { - # Check if the current version is less than the latest version - $curr_ver_num = intval(str_replace(".", "", self::get_api_version())); - $latest_ver_num = intval(str_replace(".", "", self::get_latest_api_version())); - return $curr_ver_num < $latest_ver_num; + return version_compare(self::get_api_version(), self::get_latest_api_version(), operator: "<"); } public static function get_github_releases() { From 33048b0bfbc5eafb88390f881b4122cf5d6b88b1 Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Wed, 6 Sep 2023 20:21:59 -0600 Subject: [PATCH 2/3] docs: added note about unsupported archs to readme --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 80abad6e1..6f8878d09 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,13 @@ are made preventing the need for a reboot. All this results in the fastest, safe
Supported pfSense Versions - - pfSense CE 2.7.0 (AMD64) - - pfSense Plus 23.01 (AMD64) - - pfSense Plus 23.05 (AMD64) + - pfSense CE 2.7.0 (amd64) + - pfSense Plus 23.01 (amd64) + - pfSense Plus 23.05 (amd64) - --- + _This package is not supported on other architectures such as arm64 and aarch64. However, the package should still + install and operate on these systems. Compatibility on unsupported systems is not guaranteed and is at your own risk._ + ---
From 369b890319653d590e98bc2bbddf1820738a58ca Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Sun, 10 Sep 2023 22:33:24 -0600 Subject: [PATCH 3/3] fix: prevent blank alias detail when adding first alias address #395 --- .../etc/inc/api/models/APIFirewallAliasEntryCreate.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryCreate.inc b/pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryCreate.inc index 4e1a8f850..5a8d05006 100644 --- a/pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryCreate.inc +++ b/pfSense-pkg-API/files/etc/inc/api/models/APIFirewallAliasEntryCreate.inc @@ -114,7 +114,15 @@ class APIFirewallAliasEntryCreate extends APIModel { # Get a list of the new addresses and details requested $this->initial_data["address"] = $this->__value_to_array($this->initial_data["address"]); $this->initial_data["detail"] = $this->__value_to_array($this->initial_data["detail"]); - $this->validated_data["detail"] = $this->__value_to_array(explode("||", $this->validated_data["detail"])); + + # Only expand existing details if they exist + if ($this->validated_data["detail"]) { + $this->validated_data["detail"] = $this->__value_to_array(explode("||", $this->validated_data["detail"])); + } + # Otherwise, default to an empty array + else { + $this->validated_data["detail"] = []; + } # Ensure the number of addresses is greater than or equal to the number details if (count($this->initial_data["address"]) >= count($this->initial_data["detail"])) {