WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp\Cookie

SetCookie::validate() public Yoast 1.0

Check if the cookie is valid according to RFC 6265

{} Это метод класса: SetCookie{}

Хуков нет.

Возвращает

true/false/Строку. Returns true if valid or an error message if invalid

Использование

$SetCookie = new SetCookie();
$SetCookie->validate();

Код SetCookie::validate() Yoast 15.6.2

<?php
public function validate()
{
    // Names must not be empty, but can be 0
    $name = $this->getName();
    if (empty($name) && !\is_numeric($name)) {
        return 'The cookie name must not be empty';
    }
    // Check if any of the invalid characters are present in the cookie name
    if (\preg_match('/[\\x00-\\x20\\x22\\x28-\\x29\\x2c\\x2f\\x3a-\\x40\\x5c\\x7b\\x7d\\x7f]/', $name)) {
        return 'Cookie name must not contain invalid characters: ASCII ' . 'Control characters (0-31;127), space, tab and the ' . 'following characters: ()<>@,;:\\"/?={}';
    }
    // Value must not be empty, but can be 0
    $value = $this->getValue();
    if (empty($value) && !\is_numeric($value)) {
        return 'The cookie value must not be empty';
    }
    // Domains must not be empty, but can be 0
    // A "0" is not a valid internet domain, but may be used as server name
    // in a private network.
    $domain = $this->getDomain();
    if (empty($domain) && !\is_numeric($domain)) {
        return 'The cookie domain must not be empty';
    }
    return \true;
}