diff --git a/core/Segment.php b/core/Segment.php index 2a64f705af09bb008be3020dba4c17c259dacbf6..451afdb393282dc2ebe8ebff64bd53647f80ef99 100644 --- a/core/Segment.php +++ b/core/Segment.php @@ -177,30 +177,31 @@ class Segment throw new NoAccessException("You do not have enough permission to access the segment " . $name); } - if ($matchType != SegmentExpression::MATCH_IS_NOT_NULL_NOR_EMPTY - && $matchType != SegmentExpression::MATCH_IS_NULL_OR_EMPTY) { - if (isset($segment['sqlFilterValue'])) { - $value = call_user_func($segment['sqlFilterValue'], $value); - } - - // apply presentation filter - if (isset($segment['sqlFilter'])) { - $value = call_user_func($segment['sqlFilter'], $value, $segment['sqlSegment'], $matchType, $name); + if ($matchType == SegmentExpression::MATCH_IS_NOT_NULL_NOR_EMPTY + || $matchType == SegmentExpression::MATCH_IS_NULL_OR_EMPTY) { + break; + } - if(is_null($value)) { // null is returned in TableLogAction::getIdActionFromSegment() - return array(null, $matchType, null); - } + if (isset($segment['sqlFilterValue'])) { + $value = call_user_func($segment['sqlFilterValue'], $value); + } - // sqlFilter-callbacks might return arrays for more complex cases - // e.g. see TableLogAction::getIdActionFromSegment() - if (is_array($value) && isset($value['SQL'])) { - // Special case: returned value is a sub sql expression! - $matchType = SegmentExpression::MATCH_ACTIONS_CONTAINS; - } + // apply presentation filter + if (isset($segment['sqlFilter'])) { + $value = call_user_func($segment['sqlFilter'], $value, $segment['sqlSegment'], $matchType, $name); + if(is_null($value)) { // null is returned in TableLogAction::getIdActionFromSegment() + return array(null, $matchType, null); + } + // sqlFilter-callbacks might return arrays for more complex cases + // e.g. see TableLogAction::getIdActionFromSegment() + if (is_array($value) && isset($value['SQL'])) { + // Special case: returned value is a sub sql expression! + $matchType = SegmentExpression::MATCH_ACTIONS_CONTAINS; } } + break; }