WordPress at a glance
function is not described

PHPMailer\PHPMailer

PHPMailer::isPermittedPath() protected WP 1.0

Check whether a file path is of a permitted type. Used to reject URLs and phar files from functions that access local file paths, such as addAttachment.

{} It's a method of the class: PHPMailer{}

No Hooks.

Return

true|false.

Usage

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

Code of PHPMailer::isPermittedPath() WP 5.7.2

<?php
protected static function isPermittedPath($path)
{
    //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1
    return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
}