diff --git a/.travis.yml b/.travis.yml index 190b404..01483ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,20 @@ language: php php: + - 5.3.3 + - 5.3 - 5.4 - 5.5 - 5.6 - nightly - - hhvm-nightly + - hhvm # run build against nightly but allow them to fail matrix: fast_finish: true allow_failures: - php: nightly - - php: hhvm-nightly + - php: hhvm # faster builds on new travis setup not using sudo sudo: false diff --git a/composer.json b/composer.json index 5a96b17..07cbe59 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "role": "Developer (original JS version)" }], "require": { - "php": ">=5.4", + "php": ">=5.3.3", "ext-tidy": ">=1.2" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e6a0903..6a5fee8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -27,6 +27,6 @@ - + diff --git a/src/Readability.php b/src/Readability.php index eabcca8..5b714a7 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -47,7 +47,6 @@ namespace Readability; */ class Readability { - public $version = '1.7.2-without-multi-page'; public $convertLinksToFootnotes = false; public $revertForcedParagraphElements = true; public $articleTitle; @@ -195,7 +194,13 @@ class Readability libxml_use_internal_errors(true); $this->dom = new \DOMDocument(); $this->dom->preserveWhiteSpace = false; - @$this->dom->loadHTML($html, LIBXML_NOBLANKS | LIBXML_COMPACT | LIBXML_NOERROR); + + if (PHP_VERSION_ID >= 50400) { + $this->dom->loadHTML($html, LIBXML_NOBLANKS | LIBXML_COMPACT | LIBXML_NOERROR); + } else { + $this->dom->loadHTML($html); + } + libxml_use_internal_errors(false); }