# fluent-cart/1.6.4/app/Http/Rules/SanitizeTextArea.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 43 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Rules/SanitizeTextArea.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Http/Rules/SanitizeTextArea.php
- Modified: 2026-06-11T12:21:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Rules/SanitizeTextArea.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Http\Rules;

class SanitizeTextArea
{
    public function __invoke($attr, $value, $rules, $data, ...$params)
    {
        if (!is_string($value)) {
            return sprintf(
                /* translators: %1$s: field attribute name */
                __('The %1$s must be a valid text', 'fluent-cart'),
                $attr
            );
        }
        $value = trim($value);
        
        if (is_numeric($value)) {
            $value = (string)$value;
        }

        $isString = is_string($value);
        if (!$isString) {
            return sprintf(
                /* translators: 1: attribute name */
                __('The %s must be a valid text', 'fluent-cart'),
                $attr
            );
        }
        $sanitizedValue = sanitize_textarea_field($value);
        if ($sanitizedValue !== $value) {
            return sprintf(
                /* translators: 1: attribute name */
                __('The %s must be a valid text', 'fluent-cart'),
                $attr
            );
        }

        return null;
    }

}

```
