Plugin Directory

Changeset 3000676


Ignore:
Timestamp:
11/23/2023 12:13:01 PM (2 years ago)
Author:
adreastrian
Message:

releasing v5.1.5

Location:
fluentform
Files:
1027 added
7 edited

Legend:

Unmodified
Added
Removed
  • fluentform/trunk/app/Hooks/actions.php

    r3000070 r3000676  
    212212    ];
    213213    foreach ($upgradableCheckInputs as $upgradeElement) {
    214         add_filter('fluentform/editor_init_element_' . $upgradeElement, function ($element) use ($upgradeElement) {
     214        add_filter('fluentform/editor_init_element_' . $upgradeElement, function ($element) use ($upgradeElement, $form) {
     215            $element = apply_filters('fluentform/rendering_field_data_' . $upgradeElement, $element, $form);
     216
    215217            if (!\FluentForm\Framework\Helpers\ArrayHelper::get($element, 'settings.advanced_options')) {
    216218                $formattedOptions = [];
  • fluentform/trunk/app/Services/ConditionAssesor.php

    r3000070 r3000676  
    2424            foreach ($conditionals as $conditional) {
    2525
     26                if (!Arr::get($conditional, 'field')) {
     27                    continue;
     28                }
     29
    2630                $hasConditionMet = static::assess($conditional, $inputs);
    2731
    28                 if($hasConditionMet && $toMatch == 'any') {
     32                if ($hasConditionMet && $toMatch == 'any') {
    2933                    return true;
    3034                }
  • fluentform/trunk/app/Services/Form/FormValidationService.php

    r3000285 r3000676  
    242242
    243243            if ($options) {
    244                 $options = array_map('trim', $options);
     244                $options = array_map('sanitize_text_field', $options);
    245245            }
    246246
     
    276276                    $data = (new SelectCountry())->loadCountries($fieldData);
    277277                    $validCountries = Arr::get($fieldData, 'settings.country_list.priority_based', []);
    278                     $validCountries = array_merge($validCountries,array_keys(Arr::get($data, 'options')));
     278                    $validCountries = array_merge($validCountries, array_keys(Arr::get($data, 'options')));
    279279                    $isValid = in_array($inputValue, $validCountries);
    280280                    break;
     
    298298                        $colDiff = array_diff($submitdCols, $columns);
    299299                        $isValid = empty($colDiff);
    300                     }
    301                     break;
    302                 case 'input_date':
    303                     $format = Arr::get($rawField, 'settings.date_format');
    304                     $format = str_replace(['AM', 'PM', 'K'], 'A', $format);
    305                     $dateObject = \DateTime::createFromFormat($format, $inputValue);
    306                     if (!$dateObject) {
    307                         $isValid = false;
    308                     } elseif ($dateObject->format($format) != $inputValue) {
    309                         $isValid = false;
    310300                    }
    311301                    break;
  • fluentform/trunk/fluentform.php

    r3000285 r3000676  
    44 * Plugin Name: Fluent Forms
    55 * Description: Contact Form By Fluent Forms is the advanced Contact form plugin with drag and drop, multi column supported form builder plugin
    6  * Version: 5.1.4
     6 * Version: 5.1.5
    77 * Author: Contact Form - WPManageNinja LLC
    88 * Author URI: https://fluentforms.com
     
    1919
    2020define('FLUENTFORM_FRAMEWORK_UPGRADE', '4.3.22');
    21 defined('FLUENTFORM_VERSION') or define('FLUENTFORM_VERSION', '5.1.4');
     21
     22defined('FLUENTFORM_VERSION') or define('FLUENTFORM_VERSION', '5.1.5');
    2223
    2324if (!defined('FLUENTFORM_HAS_NIA')) {
  • fluentform/trunk/readme.txt

    r3000285 r3000676  
    55Tested up to: 6.4.1
    66Requires PHP: 7.1
    7 Stable tag: 5.1.4
     7Stable tag: 5.1.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    442442== Changelog ==
    443443
     444= 5.1.5 (Date: November 23, 2023) =
     445- Fixes max length validation
     446- Improves options validation
     447- Improves date validation
     448- Improves conditional logics
     449
    444450= 5.1.4 (Date: November 22, 2023) =
    445451- Fixes advanced country list issue
  • fluentform/trunk/vendor/wpfluent/framework/src/WPFluent/Validator/ValidatesAttributes.php

    r2931107 r3000676  
    4545
    4646        switch ($type) {
    47             case 'numeric':
     47            case 'numeric' && $this->hasRule($attribute, ['numeric']):
    4848                return $value;
    4949            case 'array':
  • fluentform/trunk/vendor/wpfluent/framework/src/WPFluent/Validator/Validator.php

    r2929759 r3000676  
    303303        return $this->validatePresent($attribute, $value) || $this->isImplicit($rule);
    304304    }
     305
     306    /**
     307     * Determine if the given attribute has a rule in the given set.
     308     *
     309     * @param string $attribute
     310     * @param string|array $rules
     311     * @return bool
     312     */
     313    public function hasRule($attribute, $rules)
     314    {
     315        return ! is_null($this->getRule($attribute, $rules));
     316    }
     317
     318    /**
     319     * Get a rule and its parameters for a given attribute.
     320     *
     321     * @param string $attribute
     322     * @param string|array $rules
     323     * @return array|null
     324     */
     325    protected function getRule($attribute, $rules)
     326    {
     327        if (! array_key_exists($attribute, $this->rules)) {
     328            return;
     329        }
     330
     331        $rules = (array) $rules;
     332
     333        foreach ($this->rules[$attribute] as $rule) {
     334            list($rule, $parameters) = ValidationRuleParser::parse($rule);
     335
     336            if (in_array($rule, $rules)) {
     337                return [$rule, $parameters];
     338            }
     339        }
     340    }
    305341}
Note: See TracChangeset for help on using the changeset viewer.