[FacebookBridge] Remove hidden elements

Hidden elements are used for error conditions and generally made
visible using JavaScript. Since RSS-Bridge doesn't support JS, these
error messages are shown in the final feed. For example:

"It looks like you may be having problems playing this video. If so,
please try restarting your browser."

This commit removes all hidden elements to prevent error messages being
added to the feed.

- "It looks like you may be having problems playing this video. If so,
please try restarting your browser."
This commit is contained in:
logmanoriginal 2018-11-08 18:21:42 +01:00
parent 7026684e34
commit 104ae2298e
1 changed files with 5 additions and 0 deletions

View File

@ -589,6 +589,11 @@ EOD;
}
}
// Remove hidden elements (they are hidden anyway)
foreach($content->find('.hidden_elem') as $subject) {
$subject->outertext = '';
}
$content = preg_replace(
'/(?i)><div class=\"_3dp([^>]+)>(.+?)div\ class=\"[^u]+userContent\"/i',
'',