Minor: PHP Warning "Undefined variable $panel" in inc/policies.php on /login/ and /list/web/ (Ubuntu 26.04)

Note the post was created with the help of AI. I did my research and used AI to help my find a solution to the issue

Summary

Cosmetic issue, no functional impact. Under Ubuntu 26.04’s PHP, policies.php emits warnings that show up in /var/log/hestia/nginx-error.log whenever the login page or the web-listing page is loaded.

Environment

  • HestiaCP 1.10.5-1+ubuntu26.04
  • Ubuntu 26.04 (aarch64), upgraded from 24.04

Symptom

/var/log/hestia/nginx-error.log shows, on GET /login/ and GET /list/web/:

PHP Warning:  Undefined variable $panel in /usr/local/hestia/web/inc/policies.php on line 5
PHP Warning:  Trying to access array offset on null in /usr/local/hestia/web/inc/policies.php on line 5
PHP Warning:  Trying to access array offset on null in /usr/local/hestia/web/inc/policies.php on line 5

Impact

None observed — the pages work normally (logins, listings, File Manager all functional). The warnings only pollute the error log. Likely surfaced by the stricter undefined-variable reporting in the newer PHP version after the distro upgrade.

Suggested fix

One of the usual options for this class of notice in policies.php: initialize $panel (or its expected array element) with a default before line 5, or guard the access with isset()/null-coalescing. Not critical — logging noise only.

Thanks for the report.

I’ve created a PR to fix it:

Great, thank you! I saw your patch at GitHub!