PHPMailer\PHPMailer
PHPMailer::isPermittedPath()
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.
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
PHPMailer::isPermittedPath() PHPMailer::isPermittedPath code WP 6.7.1
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); }