getConfigUser($user_id); if ($token != $config['token']) { die(_('Uh, there is a problem with the cron.')); } $items = $store->retrieveUnfetchedEntries($user_id, $limit); foreach ($items as $item) { $url = new Url(base64_encode($item['url'])); $content = Tools::getPageContent($url); $title = ($content['rss']['channel']['item']['title'] != '') ? $content['rss']['channel']['item']['title'] : _('Untitled'); $body = $content['rss']['channel']['item']['description']; // // clean content from prevent xss attack $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $title = $purifier->purify($title); $body = $purifier->purify($body); $store->updateContentAndTitle($item['id'], $title, $body, $user_id); }