Commit 1a1d42a6 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-3999 (Match keys should not need zone or page included)

parent f12ad8bd
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1717,10 +1717,21 @@ function match_key_match($match_keys, $support_post = false, $current_params = n
    $potentials = is_array($match_keys) ? $match_keys : explode(',', $match_keys);
    foreach ($potentials as $potential) {
        $parts = is_array($potential) ? $potential : explode(':', $potential);

        // Allow the first 2 parts to be omitted, but if so we need to insert them back in here
        $prepend_zone = ((!isset($parts[0])) || (strpos($parts[0], '=') !== false));
        if ($prepend_zone) {
            $parts = array_merge(array('_WILD'), $parts);
        }
        $prepend_page = ((!isset($parts[1])) || (strpos($parts[1], '=') !== false));
        if ($prepend_page) {
            $parts = array_merge(array_slice($parts, 0, 1), array('_WILD'), array_slice($parts, 1));
        }

        if (($parts[0] == '_WILD') || ($parts[0] == '_SEARCH')) {
            $parts[0] = $current_zone_name;
        }
        if ((!isset($parts[1])) || ($parts[1] == '_WILD') || (($parts[1] == '_WILD_NOT_START') && ($current_page_name != get_zone_default_page($parts[0])))) {
        if (($parts[1] == '_WILD') || (($parts[1] == '_WILD_NOT_START') && ($current_page_name != get_zone_default_page($parts[0])))) {
            $parts[1] = $current_page_name;
        }
        if (($parts[0] == 'site') && (get_option('collapse_user_zones') == '1')) {