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

PHPMailer\PHPMailer

PHPMailer::isShellSafe() protected WP 1.0

Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.

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

Хуков нет.

Возвращает

true/false.

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

$result = PHPMailer::isShellSafe( $string );
$string(строка) (обязательный)
The string to be validated

Заметки

Код PHPMailer::isShellSafe() WP 5.5.1

<?php
protected static function isShellSafe($string)
{
    // Future-proof
    if (escapeshellcmd($string) !== $string
        || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
    ) {
        return false;
    }

    $length = strlen($string);

    for ($i = 0; $i < $length; ++$i) {
        $c = $string[$i];

        // All other characters have a special meaning in at least one common shell, including = and +.
        // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
        // Note that this does permit non-Latin alphanumeric characters based on the current locale.
        if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
            return false;
        }
    }

    return true;
}