function sanitize_rss($str) {
$res = $str;
- $res = preg_replace('/<script.*?>/i',
+/* $res = preg_replace('/<script.*?>/i',
"<p class=\"scriptWarn\">Disabled script: ", $res);
- $res = preg_replace('/<\/script.*?>/i', "</p>", $res);
+ $res = preg_replace('/<\/script.*?>/i', "</p>", $res); */
/* $res = preg_replace('/<embed.*?>/i', "", $res);
"<p class=\"objectWarn\">(Disabled html object
- flash or other embedded content)</p>", $res); */
+ if (get_pref("STRIP_UNSAFE_TAGS")) {
+ $res = strip_tags($res, "<p><a><i><em><b><strong><blockquote><br><img>");
+ }
+
return $res;
}
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_INFOBOX_DISABLE_OVERLAY', 1, 'false', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('STRIP_UNSAFE_TAGS', 1, 'true', 'Strip unsafe tags from articles', 3,
+'This option strips all, but most common HTML tags when reading articles.');
+
create table ttrss_user_prefs (
owner_uid integer not null,
pref_name varchar(250),
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_INFOBOX_DISABLE_OVERLAY', 1, 'false', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('STRIP_UNSAFE_TAGS', 1, 'true', 'Strip unsafe tags from articles', 3,
+'This option strips all, but most common HTML tags when reading articles.');
+
create table ttrss_user_prefs (
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_INFOBOX_DISABLE_OVERLAY', 1, 'false', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('STRIP_UNSAFE_TAGS', 1, 'true', 'Strip unsafe tags from articles', 3,
+'This option strips all, but most common HTML tags when reading articles.');
+
update ttrss_version set schema_version = 17;
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_INFOBOX_DISABLE_OVERLAY', 1, 'false', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('STRIP_UNSAFE_TAGS', 1, 'true', 'Strip unsafe tags from articles', 3,
+'This option strips all, but most common HTML tags when reading articles.');
+
update ttrss_version set schema_version = 17;