protected function checkForAllEmptySegments(&$segments)
{
// If all segments are empty, do not set them. No, array_filter() is not a better solution!
if (count($segments) > 0) {
$allSegmentsAreEmpty = TRUE;
foreach ($segments as $segment) {
if ($segment) {
$allSegmentsAreEmpty = FALSE;
break;
}
}
if ($allSegmentsAreEmpty) {
$segments = array();
}
}
}