protected function decodePathByOverride(array &$pathSegments)
{
$result = null;
$possibleSegments = array();
foreach ($pathSegments as $segment) {
if ($this->isPostVar($segment)) {
break;
}
$possibleSegments[] = $segment;
}
while (!empty($possibleSegments) && !$result) {
$result = $this->searchPagesByPathOverride($possibleSegments);
if (!$result) {
array_pop($possibleSegments);
}
}
if ($result) {
$pathSegments = array_slice($pathSegments, count($possibleSegments));
}
return $result;
}