From ba88c56dc138cb1c46133c29a9a760d5c0375e26 Mon Sep 17 00:00:00 2001 From: Joe Madden Date: Tue, 8 Jan 2019 08:17:42 -0600 Subject: [PATCH 1/2] Update for PHPSimple HTMLDomParser This fixes the compatibility issue with PHP 7.3 issue https://github.com/sunra/php-simple-html-dom-parser/issues/64 and https://github.com/vulcandigital/silverstripe-seo/issues/36 --- composer.json | 2 +- src/Analysis/Analysis.php | 2 +- src/Extensions/PageHealthExtension.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 289b42d..837f8ed 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "silverstripe/cms": "^4.1", "jonom/silverstripe-text-target-length": "^2", "wilr/silverstripe-googlesitemaps": "^2.1", - "sunra/php-simple-html-dom-parser": "^1.5", + "kub-at/php-simple-html-dom-parser": "^1.7", "axllent/silverstripe-trailing-slash": "^2.1" }, "require-dev": { diff --git a/src/Analysis/Analysis.php b/src/Analysis/Analysis.php index 4c37703..3fba773 100644 --- a/src/Analysis/Analysis.php +++ b/src/Analysis/Analysis.php @@ -6,7 +6,7 @@ use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Injector\Injectable; use SilverStripe\View\ArrayData; -use Sunra\PhpSimple\HtmlDomParser; +use KubAT\PhpSimple\HtmlDomParser; use Vulcan\Seo\Extensions\PageHealthExtension; /** diff --git a/src/Extensions/PageHealthExtension.php b/src/Extensions/PageHealthExtension.php index 352113b..bcb92ba 100644 --- a/src/Extensions/PageHealthExtension.php +++ b/src/Extensions/PageHealthExtension.php @@ -7,7 +7,7 @@ use SilverStripe\Forms\TextField; use SilverStripe\Forms\ToggleCompositeField; use SilverStripe\ORM\DataExtension; -use Sunra\PhpSimple\HtmlDomParser; +use KubAT\PhpSimple\HtmlDomParser; use Vulcan\Seo\Analysis\Analysis; use Vulcan\Seo\Forms\GoogleSearchPreview; use Vulcan\Seo\Forms\HealthAnalysisField; @@ -59,11 +59,11 @@ public function getRenderedHtml() if (!$this->renderedHtml) { $this->renderedHtml = file_get_contents($this->getOwner()->AbsoluteLink().'?stage=Stage'); } - + if ($this->renderedHtml === false) { $this->renderedHtml = '

'; } - + return $this->renderedHtml; } From c4814975fb8d0f7d4fad3527dedd142f38d92419 Mon Sep 17 00:00:00 2001 From: Joe Madden Date: Tue, 8 Jan 2019 08:22:36 -0600 Subject: [PATCH 2/2] Further PHP 7.3 updates Update for class namespace to resolve PHP 7.3 compatibility --- src/Analysis/Analysis.php | 2 +- src/Extensions/PageHealthExtension.php | 2 +- src/Forms/GoogleSearchPreview.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Analysis/Analysis.php b/src/Analysis/Analysis.php index 3fba773..c3bf9e0 100644 --- a/src/Analysis/Analysis.php +++ b/src/Analysis/Analysis.php @@ -153,7 +153,7 @@ public function getResult() } /** - * @return \simplehtmldom_1_5\simple_html_dom + * @return \simple_html_dom\simple_html_dom */ public function getRenderedHtmlDomParser() { diff --git a/src/Extensions/PageHealthExtension.php b/src/Extensions/PageHealthExtension.php index bcb92ba..ce45424 100644 --- a/src/Extensions/PageHealthExtension.php +++ b/src/Extensions/PageHealthExtension.php @@ -70,7 +70,7 @@ public function getRenderedHtml() /** * Gets the DOM parser for the rendered html * - * @return \simplehtmldom_1_5\simple_html_dom + * @return \simple_html_dom\simple_html_dom */ public function getRenderedHtmlDomParser() { diff --git a/src/Forms/GoogleSearchPreview.php b/src/Forms/GoogleSearchPreview.php index ec4e324..6b92528 100644 --- a/src/Forms/GoogleSearchPreview.php +++ b/src/Forms/GoogleSearchPreview.php @@ -8,7 +8,7 @@ use SilverStripe\View\ArrayData; use SilverStripe\View\Parsers\URLSegmentFilter; use SilverStripe\View\Requirements; -use simplehtmldom_1_5\simple_html_dom; +use simple_html_dom\simple_html_dom; use Vulcan\Seo\Extensions\PageHealthExtension; use Vulcan\Seo\Extensions\PageSeoExtension;