Project

General

Profile

Actions

Regression #13597

closed

pfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1

haproxy-devel PHP8 regression when saving a backend entry

Added by Marcos M about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
haproxy
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

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

Has duplicate Bug #13562: HAProxy PHP error on upgrade to PHP8.1 updateDuplicateMarcos M

Actions
Has duplicate Bug #13684: HAProxy PHP error haproxy.inc:1229DuplicateMarcos M

Actions
Actions #1

Updated by Marcos M about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Marcos M
Actions #2

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;

Actions #3

Updated by Jim Pingle almost 2 years ago

  • Parent task set to #13446
Actions #4

Updated by Marcos M almost 2 years ago

  • Has duplicate Bug #13562: HAProxy PHP error on upgrade to PHP8.1 update added
Actions #5

Updated by Marcos M almost 2 years ago

  • Has duplicate Bug #13684: HAProxy PHP error haproxy.inc:1229 added
Actions #6

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

Actions #7

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.

Actions

Also available in: Atom PDF