PHPMailer\PHPMailer

PHPMailer::fileIsAccessible()protected staticWP 1.0

Check whether a file path is safe, accessible, and readable.

Method of the class: PHPMailer{}

No Hooks.

Return

true|false.

Usage

$result = PHPMailer::fileIsAccessible( $path );
$path(string) (required)
A relative or absolute path to a file

PHPMailer::fileIsAccessible() code WP 6.4.3

protected static function fileIsAccessible($path)
{
    if (!static::isPermittedPath($path)) {
        return false;
    }
    $readable = is_file($path);
    //If not a UNC path (expected to start with \\), check read permission, see #2069
    if (strpos($path, '\\\\') !== 0) {
        $readable = $readable && is_readable($path);
    }
    return  $readable;
}