You are here

public function PharExtensionInterceptor::assert in Drupal 7

Same name in this branch
  1. 7 misc/typo3/drupal-security/PharExtensionInterceptor.php \Drupal\Core\Security\PharExtensionInterceptor::assert()
  2. 7 misc/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php \TYPO3\PharStreamWrapper\Interceptor\PharExtensionInterceptor::assert()

Determines whether the base file name has a ".phar" suffix.

Parameters

string $path:

string $command:

Return value

bool

Throws

Exception

Overrides Assertable::assert

File

misc/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php, line 28

Class

PharExtensionInterceptor

Namespace

TYPO3\PharStreamWrapper\Interceptor

Code

public function assert($path, $command) {
  if ($this
    ->baseFileContainsPharExtension($path)) {
    return true;
  }
  throw new Exception(sprintf('Unexpected file extension in "%s"', $path), 1535198703);
}