protected static function PHPMailer::isPermittedPath

5.x PHPMailer.php protected static PHPMailer::isPermittedPath($path)

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.

Parameters

string $path A relative or absolute path to a file:

Return value

bool

5 calls to PHPMailer::isPermittedPath()
PHPMailer::addAttachment in inc/PHPMailer/src/PHPMailer.php
Add an attachment from a path on the filesystem. Never use a user-supplied path to a file! Returns false if the file could not be found or read. Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. If you need to do that, fetch…
PHPMailer::addEmbeddedImage in inc/PHPMailer/src/PHPMailer.php
Add an embedded (inline) attachment from a file. This can include images, sounds, and just about any other document type. These differ from 'regular' attachments in that they are intended to be displayed inline with the message, not just…
PHPMailer::encodeFile in inc/PHPMailer/src/PHPMailer.php
Encode a file attachment in requested format. Returns an empty string on failure.
PHPMailer::preSend in inc/PHPMailer/src/PHPMailer.php
Prepare a message for sending.
PHPMailer::setLanguage in inc/PHPMailer/src/PHPMailer.php
Set the language for error messages. Returns false if it cannot load the language file. The default language is English.

File

inc/PHPMailer/src/PHPMailer.php, line 1686

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

protected static function isPermittedPath($path) 
 {
  return !preg_match('#^[a-z]+://#i', $path);
}