mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 18:35:57 +00:00
db_escape_string: remove tags by default (refs #323)
This commit is contained in:
4
db.php
4
db.php
@@ -41,7 +41,9 @@ function db_connect($host, $user, $pass, $db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function db_escape_string($s) {
|
function db_escape_string($s, $strip_tags = true) {
|
||||||
|
if ($strip_tags) $s = strip_tags($s);
|
||||||
|
|
||||||
if (DB_TYPE == "pgsql") {
|
if (DB_TYPE == "pgsql") {
|
||||||
return pg_escape_string($s);
|
return pg_escape_string($s);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -954,7 +954,7 @@
|
|||||||
$result = db_query($link, "SELECT id FROM ttrss_entries
|
$result = db_query($link, "SELECT id FROM ttrss_entries
|
||||||
WHERE guid = '$entry_guid'");
|
WHERE guid = '$entry_guid'");
|
||||||
|
|
||||||
$entry_content = db_escape_string($entry_content);
|
$entry_content = db_escape_string($entry_content, true);
|
||||||
|
|
||||||
$content_hash = "SHA1:" . sha1(strip_tags($entry_content));
|
$content_hash = "SHA1:" . sha1(strip_tags($entry_content));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user