mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-06 00:27:27 +02:00
Corrections
* Corrected GoogleBridge (URI extraction was incorrect) * Corrected ATOM format: * mime-type was incorrect * Hyperlinks were not clickable. * non-UTF8 characters are now properly filtered. * Corrected HTML format output: * Hyperlinks were not clickable. * Corrected error message when SimpleHtmlDom library is not installed. * Added changelog.
This commit is contained in:
@@ -90,6 +90,23 @@ abstract class FormatAbstract implements FormatInterface{
|
||||
|
||||
return $this->extraInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitized html while leaving it functionnal.
|
||||
* The aim is to keep html as-is (with clickable hyperlinks)
|
||||
* while reducing annoying and potentially dangerous things.
|
||||
* Yes, I know sanitizing HTML 100% is an impossible task.
|
||||
* Maybe we'll switch to http://htmlpurifier.org/
|
||||
* or http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/index.php
|
||||
*/
|
||||
public function sanitizeHtml($html)
|
||||
{
|
||||
$html = str_replace('<script','<‌script',$html); // Disable scripts, but leave them visible.
|
||||
$html = str_replace('<iframe','<‌iframe',$html);
|
||||
$html = str_replace('<link','<‌link',$html);
|
||||
// We leave alone object and embed so that videos can play in RSS readers.
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
class Format{
|
||||
|
@@ -15,7 +15,7 @@ require __DIR__ . '/Cache.php';
|
||||
|
||||
$vendorLibSimpleHtmlDom = __DIR__ . PATH_VENDOR . '/simplehtmldom/simple_html_dom.php';
|
||||
if( !file_exists($vendorLibSimpleHtmlDom) ){
|
||||
throw new \HttpException('"PHP Simple HTML DOM Parser" is missing. Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in the same folder to allow me to work.', 500);
|
||||
throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing. Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in '.substr(PATH_VENDOR,4) . '/simplehtmldom/', 500);
|
||||
}
|
||||
require_once $vendorLibSimpleHtmlDom;
|
||||
|
||||
|
Reference in New Issue
Block a user