* [Security] Fix missing integer casting for inserting new categories

(thanks to cdxy)
This commit is contained in:
Garvin Hicking 2017-01-16 11:29:15 +01:00
parent 6285933470
commit c62d667287
2 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,9 @@ Version 2.1 ()
* [Security] Redirection of comment.php now checks the referrer
and only allows the blog's host (thanks to Lee Sheldon Victor)
* [Security] Fix missing integer casting for inserting new categories
(thanks to cdxy)
* Disabled Selenium test files unless enabled

View File

@ -1523,7 +1523,7 @@ function serendipity_updertEntry($entry) {
if (is_array($categories)) {
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}entrycat WHERE entryid={$entry['id']}");
foreach ($categories as $cat) {
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}entrycat (entryid, categoryid) VALUES ({$entry['id']}, {$cat})");
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}entrycat (entryid, categoryid) VALUES ({$entry['id']}, " . (int)$cat . ")");
}
} elseif ($had_categories) {
// This case actually only happens if an existing entry is edited, and its category assignments are all removed.