Merge pull request #102 from jtojnar/local-no-domain

Do not set domainRegExp for local files
pull/105/head
Jérémy Benoist 1 year ago committed by GitHub
commit a18cd0f2a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      src/Readability.php

@ -1383,7 +1383,10 @@ class Readability implements LoggerAwareInterface
$this->logger->debug('Parsing URL: ' . $this->url); $this->logger->debug('Parsing URL: ' . $this->url);
if ($this->url) { if ($this->url) {
$this->domainRegExp = '/' . strtr((string) preg_replace('/www\d*\./', '', (string) parse_url($this->url, \PHP_URL_HOST)), ['.' => '\.']) . '/'; $host = parse_url($this->url, \PHP_URL_HOST);
if (null !== $host) {
$this->domainRegExp = '/' . strtr((string) preg_replace('/www\d*\./', '', $host), ['.' => '\.']) . '/';
}
} }
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');

Loading…
Cancel
Save