Skip to content

Commit

Permalink
update rssfeeds upgrade script now checks for and corrects duplicate …
Browse files Browse the repository at this point in the history
…rss feed sef urls [#756 state:resolved]
  • Loading branch information
dleffler committed Dec 10, 2012
1 parent c821b16 commit 154c82c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions install/upgrades/update_rssfeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ function upgrade() {
$params['rss_cachetime'] = !empty($config['rss_cachetime']) ? $config['rss_cachetime'] : 1440;
if (!empty($config['itunes_cats'])) $params['itunes_cats'] = $config['itunes_cats'];
$rssfeed = new expRss($params);
// now check for duplicate sef_url and create a unique one if needed
$dupefeed = $rssfeed->find('all',"sef_url='".$params['sef_url']."'");
if (!empty($dupefeed)) {
list($u, $s) = explode(' ',microtime());
$params['sef_url'] .= '-'.$s.'-'.$u;
}
$rssfeed->update($params);
// backfill the rss sef_url into the module config
if (empty($config['feed_sef_url'])) {
Expand Down

0 comments on commit 154c82c

Please sign in to comment.