protected function _fieldsList(array $check)
    {
        $locked = '';
        $token = urldecode($check['_Token']['fields']);
        $unlocked = $this->_unlocked($check);

        if (strpos($token, ':')) {
            list($token, $locked) = explode(':', $token, 2);
        }
        unset($check['_Token'], $check['_csrfToken']);

        $locked = explode('|', $locked);
        $unlocked = explode('|', $unlocked);

        $fields = Hash::flatten($check);
        $fieldList = array_keys($fields);
        $multi = $lockedFields = [];
        $isUnlocked = false;

        foreach ($fieldList as $i => $key) {
            if (preg_match('/(\.\d+){1,10}$/', $key)) {
                $multi[$i] = preg_replace('/(\.\d+){1,10}$/', '', $key);
                unset($fieldList[$i]);
            } else {
                $fieldList[$i] = (string)$key;
            }
        }
        if (!empty($multi)) {
            $fieldList += array_unique($multi);
        }

        $unlockedFields = array_unique(
            array_merge((array)$this->getConfig('disabledFields'), (array)$this->_config['unlockedFields'], $unlocked)
        );

        foreach ($fieldList as $i => $key) {
            $isLocked = (is_array($locked) && in_array($key, $locked));

            if (!empty($unlockedFields)) {
                foreach ($unlockedFields as $off) {
                    $off = explode('.', $off);
                    $field = array_values(array_intersect(explode('.', $key), $off));
                    $isUnlocked = ($field === $off);
                    if ($isUnlocked) {
                        break;
                    }
                }
            }

            if ($isUnlocked || $isLocked) {
                unset($fieldList[$i]);
                if ($isLocked) {
                    $lockedFields[$key] = $fields[$key];
                }
            }
        }
        sort($fieldList, SORT_STRING);
        ksort($lockedFields, SORT_STRING);
        $fieldList += $lockedFields;

        return $fieldList;
    }
protected function _fieldsList(array $check)
    {
        $locked = '';
        $token = urldecode($check['_Token']['fields']);
        $unlocked = $this->_unlocked($check);

        if (strpos($token, ':')) {
            list($token, $locked) = explode(':', $token, 2);
        }
        unset($check['_Token'], $check['_csrfToken']);

        $locked = explode('|', $locked);
        $unlocked = explode('|', $unlocked);

        $fields = Hash::flatten($check);
        $fieldList = array_keys($fields);
        $multi = $lockedFields = [];
        $isUnlocked = false;

        foreach ($fieldList as $i => $key) {
            if (preg_match('/(\.\d+){1,10}$/', $key)) {
                $multi[$i] = preg_replace('/(\.\d+){1,10}$/', '', $key);
                unset($fieldList[$i]);
            } else {
                $fieldList[$i] = (string)$key;
            }
        }
        if (!empty($multi)) {
            $fieldList += array_unique($multi);
        }

        $unlockedFields = array_unique(
            array_merge((array)$this->getConfig('disabledFields'), (array)$this->_config['unlockedFields'], $unlocked)
        );

        foreach ($fieldList as $i => $key) {
            $isLocked = (is_array($locked) && in_array($key, $locked));

            if (!empty($unlockedFields)) {
                foreach ($unlockedFields as $off) {
                    $off = explode('.', $off);
                    $field = array_values(array_intersect(explode('.', $key), $off));
                    $isUnlocked = ($field === $off);
                    if ($isUnlocked) {
                        break;
                    }
                }
            }

            if ($isUnlocked || $isLocked) {
                unset($fieldList[$i]);
                if ($isLocked) {
                    $lockedFields[$key] = $fields[$key];
                }
            }
        }
        sort($fieldList, SORT_STRING);
        ksort($lockedFields, SORT_STRING);
        $fieldList += $lockedFields;

        return $fieldList;
    }
protected function _fieldsList ( array $ check ) { $ locked = '' ; $ token = urldecode ( $ check [ '_Token' ] [ 'fields' ] ) ; $ unlocked = $ this -> _unlocked ( $ check ) ; if ( strpos ( $ token , ':' ) ) { list ( $ token , $ locked ) = explode ( ':' , $ token , 2 ) ; } unset ( $ check [ '_Token' ] , $ check [ '_csrfToken' ] ) ; $ locked = explode ( '|' , $ locked ) ; $ unlocked = explode ( '|' , $ unlocked ) ; $ fields = Hash :: flatten ( $ check ) ; $ fieldList = array_keys ( $ fields ) ; $ multi = $ lockedFields = [ ] ; $ isUnlocked = false ; foreach ( $ fieldList as $ i => $ key ) { if ( preg_match ( '/(\.\d+){1,10}$/' , $ key ) ) { $ multi [ $ i ] = preg_replace ( '/(\.\d+){1,10}$/' , '' , $ key ) ; unset ( $ fieldList [ $ i ] ) ; } else { $ fieldList [ $ i ] = ( string ) $ key ; } } if ( ! empty ( $ multi ) ) { $ fieldList += array_unique ( $ multi ) ; } $ unlockedFields = array_unique ( array_merge ( ( array ) $ this -> getConfig ( 'disabledFields' ) , ( array ) $ this -> _config [ 'unlockedFields' ] , $ unlocked ) ) ; foreach ( $ fieldList as $ i => $ key ) { $ isLocked = ( is_array ( $ locked ) && in_array ( $ key , $ locked ) ) ; if ( ! empty ( $ unlockedFields ) ) { foreach ( $ unlockedFields as $ off ) { $ off = explode ( '.' , $ off ) ; $ field = array_values ( array_intersect ( explode ( '.' , $ key ) , $ off ) ) ; $ isUnlocked = ( $ field === $ off ) ; if ( $ isUnlocked ) { break ; } } } if ( $ isUnlocked || $ isLocked ) { unset ( $ fieldList [ $ i ] ) ; if ( $ isLocked ) { $ lockedFields [ $ key ] = $ fields [ $ key ] ; } } } sort ( $ fieldList , SORT_STRING ) ; ksort ( $ lockedFields , SORT_STRING ) ; $ fieldList += $ lockedFields ; return $ fieldList ; }
Return the fields list for the hash calculation

@param array $check Data array
@return array
Return the fields list for the hash calculation