Regression #13597
closedpfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1
haproxy-devel PHP8 regression when saving a backend entry
100%
Description
When saving a backend in haproxy-devel on 22.11, the following PHP error is thrown and the backend entry is not saved:
Fatal error: Uncaught Error: Non-static method haproxy_utils::is_valid_haproxy_hostname() cannot be called statically in /usr/local/www/haproxy/haproxy_pool_edit.php:434 Stack trace: #0 {main} thrown in /usr/local/www/haproxy/haproxy_pool_edit.php on line 434 PHP ERROR: Type: 1, File: /usr/local/www/haproxy/haproxy_pool_edit.php, Line: 434, Message: Uncaught Error: Non-static method haproxy_utils::is_valid_haproxy_hostname() cannot be called statically in /usr/local/www/haproxy/haproxy_pool_edit.php:434 Stack trace: #0 {main} thrown
Related issues
Updated by Marcos M about 2 years ago
- Status changed from New to In Progress
- Assignee set to Marcos M
Updated by Marcos M about 2 years ago
- Status changed from In Progress to Pull Request Review
This fix is for both haproxy and haproxy-devel:
https://gitlab.netgate.com/pfSense/FreeBSD-ports/-/merge_requests/291
For -devel (use System Patches package with a path strip count of 4):
diff --git a/net/pfSense-pkg-haproxy-devel/files/usr/local/pkg/haproxy/haproxy_utils.inc b/net/pfSense-pkg-haproxy-devel/files/usr/local/pkg/haproxy/haproxy_utils.inc index 61c1924333d6c239cf048b6bc16c8333f055e93d..a26e3e2d75080c8ad2525f1691229c6a35502911 100644 --- a/net/pfSense-pkg-haproxy-devel/files/usr/local/pkg/haproxy/haproxy_utils.inc +++ b/net/pfSense-pkg-haproxy-devel/files/usr/local/pkg/haproxy/haproxy_utils.inc @@ -30,7 +30,7 @@ require_once("config.inc"); class haproxy_utils { public static $pf_version; - public function is_valid_haproxy_hostname($hostname){ + public static function is_valid_haproxy_hostname($hostname){ global $input_errors; $parts = explode('@', $hostname); if (count($parts) > 2) { @@ -53,21 +53,21 @@ class haproxy_utils { } return is_hostname($hostnamename); } - public function haproxy_hostname_strip_prefix($hostname){ + public static function haproxy_hostname_strip_prefix($hostname){ $i = stripos($hostname, '@'); if ($i !== false) { $hostname = substr($hostname, $i + 1); } return $hostname; } - public function haproxy_hostname_get_prefix($hostname){ + public static function haproxy_hostname_get_prefix($hostname){ $i = stripos($hostname, '@'); if ($i !== false) { return substr($hostname, 0, $i + 1); } return false; } - public function query_dns($host, $querytype="A,AAAA") { + public static function query_dns($host, $querytype="A,AAAA") { $result = array(); $types = explode(',',$querytype); $recordtype = 0;
Updated by Marcos M almost 2 years ago
- Has duplicate Bug #13562: HAProxy PHP error on upgrade to PHP8.1 update added
Updated by Marcos M almost 2 years ago
- Has duplicate Bug #13684: HAProxy PHP error haproxy.inc:1229 added
Updated by Jim Pingle almost 2 years ago
- Status changed from Pull Request Review to Feedback
- % Done changed from 0 to 100
This was merged a week ago
Updated by Jim Pingle almost 2 years ago
- Status changed from Feedback to Resolved
No errors when editing backends in current version of haproxy package on the latest snapshot.