From 4ddbd26787ebbf4c5e01061ac9dbee4f8c21421b Mon Sep 17 00:00:00 2001 From: memiks Date: Tue, 23 Apr 2013 07:22:19 -0500 Subject: Ajout du global msg et gestion du retour dans Readability --- inc/Readability.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inc/Readability.php') diff --git a/inc/Readability.php b/inc/Readability.php index c50bf2ef..19298c13 100644 --- a/inc/Readability.php +++ b/inc/Readability.php @@ -80,7 +80,7 @@ class Readability public $debug = false; protected $body = null; // protected $bodyCache = null; // Cache the body HTML in case we need to re-use it later - protected $flags = self::FLAG_CLEAN_CONDITIONALLY; // 1 | 2 | 4; // Start with all flags set. + protected $flags = Self::FLAG_CLEAN_CONDITIONALLY; // 1 | 2 | 4; // Start with all flags set. protected $success = false; // indicates whether we were able to extract or not /** @@ -90,7 +90,7 @@ class Readability public $regexps = array( 'unlikelyCandidates' => '/combx|comment|comments|community|disqus|extra|foot|header|menu|remark|rss|shoutbox|sidebar|sponsor|ad-break|agegate|pagination|pager|popup|tweet|twitter/i', 'okMaybeItsACandidate' => '/and|article|body|column|main|shadow/i', - 'positive' => '/article|body|content|entry|hentry|main|page|pagination|post|text|blog|story/i', + 'positive' => '/article|body|content|entry|hentry|main|page|pagination|post|text|blog|story|attachment/i', 'negative' => '/combx|comment|comments|com-|contact|foot|footer|footnote|masthead|media|meta|outbrain|promo|related|scroll|shoutbox|sidebar|sponsor|shopping|tags|tool|widget/i', 'divToPElements' => '/<(a|blockquote|dl|div|ol|p|pre|table|ul)/i', 'replaceBrs' => '/(]*>[ \n\r\t]*){2,}/i', @@ -106,7 +106,7 @@ class Readability * Create instance of Readability * @param string UTF-8 encoded string * @param string (optional) URL associated with HTML (used for footnotes) - */ + */ function __construct($html, $url=null) { /* Turn all double br's into p's */ @@ -185,6 +185,7 @@ class Readability $articleContent = $this->dom->createElement('div'); $articleContent->setAttribute('id', 'readability-content'); $articleContent->innerHTML = '

Sorry, Readability was unable to parse this page for content.

'; + return $this->success; } $overlay->setAttribute('id', 'readOverlay'); -- cgit v1.2.3