- VALUES ($ref_id, $owner_uid, $feed, false,
- NULL, $marked, $published, $score, '$tag_cache',
- '', '', '$note')");
-
- $label_cache = json_decode($article['label_cache'], true);
-
- if (is_array($label_cache) && $label_cache["no-labels"] != 1) {
- foreach ($label_cache as $label) {
-
- Labels::create($label[1],
- $label[2], $label[3], $owner_uid);
-
- Labels::add_article($ref_id, $label[1], $owner_uid);
-
+ VALUES (?, ?, ?, false,
+ NULL, ?, ?, ?, ?, '', '', ?)");
+
+ $res = $sth->execute([
+ $ref_id,
+ $owner_uid,
+ $feed,
+ (int)sql_bool_to_bool($article['marked']),
+ (int)sql_bool_to_bool($article['published']),
+ $score,
+ $tag_cache,
+ $note]);
+
+ if ($res) {
+
+ $label_cache = json_decode($article['label_cache'], true);
+
+ if (is_array($label_cache) && $label_cache["no-labels"] != 1) {
+ foreach ($label_cache as $label) {
+ Labels::create($label[1],
+ $label[2], $label[3], $owner_uid);
+
+ Labels::add_article($ref_id, $label[1], $owner_uid);
+ }