Browse Source

af_readability: construct readability object inside try-catch block

Andrew Dolgov 1 year ago
parent
commit
fd8f8c7b3e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      plugins/af_readability/init.php

+ 2 - 2
plugins/af_readability/init.php

@@ -176,9 +176,9 @@ class Af_Readability extends Plugin {
 				$tmp = $tmpdoc->saveHTML();
 			}
 
-			$r = new Readability(new Configuration());
-
 			try {
+				$r = new Readability(new Configuration());
+
 				if ($r->parse($tmp)) {
 
 					$tmpxpath = new DOMXPath($r->getDOMDOcument());