PHPMailer\PHPMailer

PHPMailer::isPermittedPath()protected staticWP 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 6.0

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);
}