Files
zoneminder/web/skins/classic/includes
nicandClaude Opus 5.5 f4b46657b3 fix: stop fixAmps() recursing forever on a navbar link with an entity (#5210)
* fix: stop fixAmps() recursing forever on a navbar link with an entity

fixAmps() is declared with one parameter but called itself with a
position, which PHP drops, so every call searched from the first '&'
again. Once ZM_WEB_NAVBAR_LINKS held an entity (&, ', ...) or a
bare '&' followed later by a ';', rendering the left navbar recursed until
PHP ran out of memory, and every page answered 500 for users who use the
left navbar.

Escape the bare ampersands in one preg_replace() instead. Character
references are matched at the '&' itself, so a bare '&' is no longer
taken as valid because an entity appears later in the string, and
hexadecimal references (') are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: read the view of a navbar link only when its href has one

getAdditionalLinksHTML() parsed every left navbar link's href as if it
carried a query string with a view parameter. A link to another site
(https://host/docs) logged 'Undefined array key "query"', a parse_str()
deprecation and 'Undefined array key "view"' on every page view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 11:04:47 -04:00
..