You are here

public static function PageProcessor::urlIsDocumentFile in Mini site 8

Check if the provxided URL is a non-HTML document.

Parameters

string $url: URL to assess.

Return value

string TRUE if the provided URL is a non-HTML document, FALSE otherwise.

Overrides PageProcessorInterface::urlIsDocumentFile

1 call to PageProcessor::urlIsDocumentFile()
PageProcessor::processTagA in src/PageProcessor.php
Process <a> tag.

File

src/PageProcessor.php, line 78

Class

PageProcessor
Class PageProcessor.

Namespace

Drupal\minisite

Code

public static function urlIsDocumentFile($url) {
  $regex = '/\\.(' . preg_replace('/ +/', '|', preg_quote(PageProcessorInterface::EXTENSIONS_NON_HTML_DOCUMENTS)) . ')$/i';
  return (bool) preg_match($regex, $url);
}