Issue #3503872 by sriram, drupalfan2: Guard breadcrumb segment limit against...

Adds a max(0, $segment_limit) guard before the segment-trimming loop in EasyBreadcrumbBuilder::build().

When "Limit the number of segments to display" is enabled with a segment count of 0 and the home segment included, $segment_limit is decremented to -1. A directly-entered negative value causes the same state. Because count() is never negative, while (count($links) > $segment_limit) is then always true and loops forever, hanging every page request.

Clamping the limit to a minimum of 0 immediately before the loop fixes both cases (0-with-home and directly-entered negative), which is broader than guarding only inside the home-segment block.

Merge request reports

Loading