Improve conditions in migration script

This commit is contained in:
Frederic Guillot 2017-01-05 21:13:33 -05:00
parent c8a6f45b93
commit a1a7de82dc

View File

@ -109,10 +109,10 @@ function copy_feeds(PDO $db, $user_id, array $feeds)
$feed['feed_url'],
$feed['site_url'],
$feed['title'],
$feed['enabled'] ?: 1,
$feed['download_content'] ?: 0,
$feed['rtl'] ?: 0,
$feed['cloak_referrer'] ?: 0,
isset($feed['enabled']) ? (int) $feed['enabled'] : 1,
isset($feed['download_content']) ? (int) $feed['download_content'] : 0,
isset($feed['rtl']) ? (int) $feed['rtl'] : 0,
isset($feed['cloak_referrer']) ? (int) $feed['cloak_referrer'] : 0,
));
$feed_ids[$feed['id']] = $db->lastInsertId();
@ -135,12 +135,12 @@ function copy_items(PDO $db, $user_id, array $feed_ids, array $items)
$feed_ids[$item['feed_id']],
$item['id'],
$item['status'],
$item['bookmark'] ?: 0,
isset($item['bookmark']) ? (int) $item['bookmark'] : 0,
$item['url'],
$item['title'],
$item['author'],
$item['content'],
$item['updated'] ?: 0,
isset($item['updated']) ? (int) $item['updated'] : 0,
$item['enclosure'],
$item['enclosure_type'],
$item['language'],