Ticket #1055: podpress_feed_fix_for_882.diff
| File podpress_feed_fix_for_882.diff, 19.3 KB (added by ntm, 3 years ago) |
|---|
-
podpress.php
1 1 <?php 2 2 define('PODPRESS_VERSION', '8.8'); 3 define('PODPRESS_MAINTENANCE_VERSION', '8.8.3'); 3 4 /* 4 5 Info for WordPress: 5 6 ============================================================================== 6 7 Plugin Name: podPress 7 Version: 8.8. 28 Version: 8.8.3 8 9 Plugin URI: http://www.mightyseek.com/podpress/ 9 10 Description: The podPress pluggin gives you everything you need in one easy plugin to use WordPress for Podcasting. Set it up in <a href="admin.php?page=podpress/podpress_feed.php">'podPress'->Feed/iTunes Settings</a>. If you this plugin works for you, send us a comment. 10 11 Author: Dan Kuykendall (Seek3r) -
podpress_admin_class.php
1249 1249 1250 1250 function edit_category_form($input) { 1251 1251 $data = podPress_get_option('podPress_category_'.$input->cat_ID); 1252 1252 $blog_charset = get_bloginfo('charset'); 1253 1253 if(empty($data['podcastFeedURL'])) { 1254 1254 $data['podcastFeedURL'] = get_settings('siteurl').'/?feed=rss2&cat='.$input->cat_ID; 1255 1255 } … … 1281 1281 echo ' <td width="50%">'; 1282 1282 echo ' <label for="iTunesFeedID"><strong>'.__('iTunes:FeedID', 'podpress').'</strong></label>'; 1283 1283 echo ' <br/>'; 1284 echo ' <input name="iTunesFeedID" id="iTunesFeedID" type="text" value="'.htmlentities($data['iTunesFeedID'], ENT_QUOTES, get_settings('blog_charset')).'" size="10" />';1284 echo ' <input name="iTunesFeedID" id="iTunesFeedID" type="text" value="'.htmlentities($data['iTunesFeedID'], ENT_QUOTES, $blog_charset).'" size="10" />'; 1285 1285 echo ' <input type="button" name="Ping_iTunes_update" value="Ping iTunes Update" onclick="javascript: if(document.getElementById(\'iTunesFeedID\').value != \'\') { window.open(\'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=\'+document.getElementById(\'iTunesFeedID\').value); }"/>'."\n"; 1286 1286 echo ' </td>'."\n"; 1287 1287 1288 1288 echo ' <td width="50%">'; 1289 1289 echo ' <label for="podcastFeedURL"><strong>'.__('Podcast Feed URL', 'podpress').'</strong></label>'; 1290 1290 echo ' <br/>'; 1291 echo ' <input type="text" id="podcastFeedURL" name="podcastFeedURL" size="40" value="'.htmlentities(stripslashes($data['podcastFeedURL']), ENT_QUOTES, get_settings('blog_charset')).'" /><br />'.__('The RSS Feed URL to your podcast.', 'podpress');1291 echo ' <input type="text" id="podcastFeedURL" name="podcastFeedURL" size="40" value="'.htmlentities(stripslashes($data['podcastFeedURL']), ENT_QUOTES, $blog_charset).'" /><br />'.__('The RSS Feed URL to your podcast.', 'podpress'); 1292 1292 echo ' </td>'."\n"; 1293 1293 echo ' </tr>'."\n"; 1294 1294 … … 1326 1326 echo ' <option value="Append" '; if($data['blognameChoice'] == 'Append') { echo 'selected="selected"'; } echo '>'.__('Append Category Name', 'podpress').'</option>'."\n"; 1327 1327 echo ' <option value="CategoryName" '; if($data['blognameChoice'] == 'CategoryName') { echo 'selected="selected"'; } echo '>'.__('Use Category Name', 'podpress').'</option>'."\n"; 1328 1328 echo ' </select>'."\n"; 1329 echo ' <input type="hidden" id="global_blogname" value="'.htmlentities(stripslashes(get_option('blogname')), ENT_QUOTES, get_settings('blog_charset')).'" /></td>'."\n";1329 echo ' <input type="hidden" id="global_blogname" value="'.htmlentities(stripslashes(get_option('blogname')), ENT_QUOTES, $blog_charset).'" /></td>'."\n"; 1330 1330 echo ' </td>'."\n"; 1331 1331 echo ' </tr>'."\n"; 1332 1332 … … 1338 1338 echo ' <option value="Global" '; if($data['iTunesSummaryChoice'] != 'Custom') { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').'</option>'."\n"; 1339 1339 echo ' <option value="Custom" '; if($data['iTunesSummaryChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1340 1340 echo ' </select>'."\n"; 1341 echo ' <input type="hidden" id="global_iTunesSummary" value="'.htmlentities(stripslashes($this->settings['iTunes']['summary']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1341 echo ' <input type="hidden" id="global_iTunesSummary" value="'.htmlentities(stripslashes($this->settings['iTunes']['summary']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1342 1342 echo ' <div id="iTunesSummaryWrapper" style="display: none;">'."\n"; 1343 echo ' <textarea name="iTunesSummary" id="iTunesSummary" rows="4" cols="40" onchange="javascript: podPress_updateCategoryCasting();">'.htmlentities(stripslashes($data['iTunesSummary']), ENT_QUOTES, get_settings('blog_charset')).'</textarea>'."\n";1343 echo ' <textarea name="iTunesSummary" id="iTunesSummary" rows="4" cols="40" onchange="javascript: podPress_updateCategoryCasting();">'.htmlentities(stripslashes($data['iTunesSummary']), ENT_QUOTES, $blog_charset).'</textarea>'."\n"; 1344 1344 echo ' </div>'."\n"; 1345 1345 echo ' <div id="iTunesSummaryHelp" style="display: none;">'."\n"; 1346 1346 echo ' '.__('By default this is taken from the blog Post text.', 'podpress')."\n"; … … 1353 1353 echo ' <option value="Global" '; if($data['blogdescriptionChoice'] != 'CategoryDescription') { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').'</option>'."\n"; 1354 1354 echo ' <option value="CategoryDescription" '; if($data['blogdescriptionChoice'] == 'CategoryDescription') { echo 'selected="selected"'; } echo '>'.__('Use Category Description', 'podpress').'</option>'."\n"; 1355 1355 echo ' </select>'."\n"; 1356 echo ' <input type="hidden" id="global_blogdescription" value="'.htmlentities(stripslashes(get_option('blogdescription')), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1356 echo ' <input type="hidden" id="global_blogdescription" value="'.htmlentities(stripslashes(get_option('blogdescription')), ENT_QUOTES, $blog_charset).'" />'."\n"; 1357 1357 echo ' </td>'."\n"; 1358 1358 echo ' </tr>'."\n"; 1359 1359 … … 1399 1399 echo ' <option value="Custom" '; if($data['iTunesAuthorChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1400 1400 echo ' </select>'."\n"; 1401 1401 echo ' <div id="iTunesAuthorWrapper" style="display: none;">'."\n"; 1402 echo ' <input type="text" name="iTunesAuthor" size="40" id="iTunesAuthor" value="'.htmlentities(stripslashes($data['iTunesAuthor']), ENT_QUOTES, get_settings('blog_charset')).'" onchange="javascript: podPress_updateCategoryCasting();"/>';1403 echo ' <input type="hidden" id="global_iTunesAuthor" value="'.htmlentities(stripslashes($this->settings['iTunes']['author']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1402 echo ' <input type="text" name="iTunesAuthor" size="40" id="iTunesAuthor" value="'.htmlentities(stripslashes($data['iTunesAuthor']), ENT_QUOTES, $blog_charset).'" onchange="javascript: podPress_updateCategoryCasting();"/>'; 1403 echo ' <input type="hidden" id="global_iTunesAuthor" value="'.htmlentities(stripslashes($this->settings['iTunes']['author']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1404 1404 echo ' </div>'."\n"; 1405 1405 echo ' <div id="iTunesAuthorHelp" style="display: none;">'."\n"; 1406 1406 echo ' '.__('Used if this Author is different than the feeds author.', 'podpress')."\n"; … … 1414 1414 echo ' <option value="Custom" '; if($data['iTunesAuthorEmailChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1415 1415 echo ' </select>'."\n"; 1416 1416 echo ' <div id="iTunesAuthorEmailWrapper" style="display: none;">'."\n"; 1417 echo ' <input type="text" name="iTunesAuthorEmail" size="40" id="iTunesAuthorEmail" value="'.htmlentities(stripslashes($data['iTunesAuthorEmail']), ENT_QUOTES, get_settings('blog_charset')).'" onchange="javascript: podPress_updateCategoryCasting();"/>';1418 echo ' <input type="hidden" id="global_iTunesAuthorEmail" value="'.htmlentities(stripslashes(get_option('admin_email')), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1417 echo ' <input type="text" name="iTunesAuthorEmail" size="40" id="iTunesAuthorEmail" value="'.htmlentities(stripslashes($data['iTunesAuthorEmail']), ENT_QUOTES, $blog_charset).'" onchange="javascript: podPress_updateCategoryCasting();"/>'; 1418 echo ' <input type="hidden" id="global_iTunesAuthorEmail" value="'.htmlentities(stripslashes(get_option('admin_email')), ENT_QUOTES, $blog_charset).'" />'."\n"; 1419 1419 echo ' </div>'."\n"; 1420 1420 echo ' <div id="iTunesAuthorEmailHelp" style="display: none;">'."\n"; 1421 1421 echo ' '.__('Used if this owner of this category is different than the feeds owner.', 'podpress')."\n"; … … 1432 1432 echo ' <option value="Custom" '; if($data['iTunesSubtitleChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1433 1433 echo ' </select>'."\n"; 1434 1434 echo ' <div id="iTunesSubtitleWrapper" style="display: none;">'."\n"; 1435 echo ' <textarea name="iTunesSubtitle" rows="4" cols="40">'.htmlentities(stripslashes($data['iTunesSubtitle']), ENT_QUOTES, get_settings('blog_charset')).'</textarea>'."\n";1435 echo ' <textarea name="iTunesSubtitle" rows="4" cols="40">'.htmlentities(stripslashes($data['iTunesSubtitle']), ENT_QUOTES, $blog_charset).'</textarea>'."\n"; 1436 1436 echo ' </div>'."\n"; 1437 1437 echo ' <div id="iTunesSubtitleHelp" style="display: none;">'."\n"; 1438 1438 echo ' '.__('By default this is taken from the first 25 characters of the blog Post text.', 'podpress')."\n"; … … 1459 1459 echo ' <option value="Custom" '; if($data['iTunesKeywordsChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1460 1460 echo ' </select>'."\n"; 1461 1461 echo ' <div id="iTunesKeywordsWrapper" style="display: none;">'."\n"; 1462 echo ' '.__('Separate multiples with commas', 'podpress').', '.__('max 8', 'podpress').'<br/><textarea name="iTunesKeywords" rows="4" cols="40">'.htmlentities(stripslashes($data['iTunesKeywords']), ENT_QUOTES, get_settings('blog_charset')).'</textarea>'."\n";1462 echo ' '.__('Separate multiples with commas', 'podpress').', '.__('max 8', 'podpress').'<br/><textarea name="iTunesKeywords" rows="4" cols="40">'.htmlentities(stripslashes($data['iTunesKeywords']), ENT_QUOTES, $blog_charset).'</textarea>'."\n"; 1463 1463 echo ' </div>'."\n"; 1464 1464 echo ' <div id="iTunesKeywordsHelp" style="display: none;">'."\n"; 1465 1465 echo ' '.__('Not visible in iTunes, but used for searches.', 'podpress')."\n"; … … 1473 1473 echo ' <br/>'; 1474 1474 echo ' <select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting();">'."\n"; 1475 1475 echo ' <option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][0].')</option>'."\n"; 1476 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][0]), ENT_QUOTES, get_settings('blog_charset'));1476 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][0]), ENT_QUOTES, $blog_charset); 1477 1477 echo ' </select><br/>'."\n"; 1478 echo ' <input type="hidden" id="global_iTunesCategory" value="'.htmlentities(stripslashes($this->settings['iTunes']['category'][0]), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1478 echo ' <input type="hidden" id="global_iTunesCategory" value="'.htmlentities(stripslashes($this->settings['iTunes']['category'][0]), ENT_QUOTES, $blog_charset).'" />'."\n"; 1479 1479 echo ' <select name="iTunesCategory[1]">'."\n"; 1480 1480 echo ' <option value="##Global##" '; if($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][1].')</option>'."\n"; 1481 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][1]), ENT_QUOTES, get_settings('blog_charset'));1481 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][1]), ENT_QUOTES, $blog_charset); 1482 1482 echo ' </select><br/>'."\n"; 1483 1483 echo ' <select name="iTunesCategory[2]">'."\n"; 1484 1484 echo ' <option value="##Global##" '; if($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][2].')</option>'."\n"; 1485 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][2]), ENT_QUOTES, get_settings('blog_charset'));1485 podPress_itunesCategoryOptions(htmlentities($data['iTunesCategory'][2]), ENT_QUOTES, $blog_charset); 1486 1486 echo ' </select>'."\n"; 1487 1487 echo ' </td>'."\n"; 1488 1488 echo ' </tr>'."\n"; … … 1510 1510 echo ' <option value="Custom" '; if($data['rss_copyrightChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1511 1511 echo ' </select>'."\n"; 1512 1512 echo ' <div id="rss_copyrightWrapper" style="display: none;">'."\n"; 1513 echo ' <input type="text" name="rss_copyright" size="40" id="rss_copyright" value="'.htmlentities(stripslashes($data['rss_copyright']), ENT_QUOTES, get_settings('blog_charset')).'" onchange="javascript: podPress_updateCategoryCasting();"/>';1513 echo ' <input type="text" name="rss_copyright" size="40" id="rss_copyright" value="'.htmlentities(stripslashes($data['rss_copyright']), ENT_QUOTES, $blog_charset).'" onchange="javascript: podPress_updateCategoryCasting();"/>'; 1514 1514 echo ' <br />'.__('Enter the complete copyright string or the license name. For example: Copyright © by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress')."\n"; 1515 echo ' <input type="hidden" id="global_rss_copyright" value="'.htmlentities(stripslashes($this->settings['rss_copyright']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1515 echo ' <input type="hidden" id="global_rss_copyright" value="'.htmlentities(stripslashes($this->settings['rss_copyright']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1516 1516 echo ' </div>'."\n"; 1517 1517 echo ' <div id="rss_copyrightHelp" style="display: none;">'."\n"; 1518 1518 echo ' '.__('Used if this Copyright phrase should be different than the global copyright phrase.', 'podpress')."\n"; … … 1527 1527 echo ' <option value="Custom" '; if($data['rss_license_urlChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1528 1528 echo ' </select>'."\n"; 1529 1529 echo ' <div id="rss_license_urlWrapper" style="display: none;">'."\n"; 1530 echo ' <input name="rss_license_url" type="text" id="rss_license_url" value="'.htmlentities($data['rss_license_url'], ENT_QUOTES, get_settings('blog_charset')).'" size="65%" />'."\n";1530 echo ' <input name="rss_license_url" type="text" id="rss_license_url" value="'.htmlentities($data['rss_license_url'], ENT_QUOTES, $blog_charset).'" size="65%" />'."\n"; 1531 1531 echo ' <br />'.__('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress')."<br/><br/>\n"; 1532 echo ' <input type="hidden" id="global_rss_license_url" value="'.htmlentities(stripslashes($this->settings['rss_license_url']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n";1532 echo ' <input type="hidden" id="global_rss_license_url" value="'.htmlentities(stripslashes($this->settings['rss_license_url']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1533 1533 echo ' </div>'."\n"; 1534 1534 echo ' <div id="rss_license_urlHelp" style="display: none;">'."\n"; 1535 1535 echo ' '.__('Used if this license URL should be different than the global license URL.', 'podpress')."\n"; … … 1565 1565 } 1566 1566 1567 1567 function edit_category($cat_ID) { 1568 $blog_charset = get_bloginfo('charset'); 1568 1569 if(!isset($_POST['iTunesFeedID'])){ 1569 1570 return; 1570 1571 } -
podpress_feed_functions.php
111 111 } 112 112 } else { 113 113 $data['rss_copyright'] = $podPress->settings['rss_copyright']; 114 if (0 < strlen($podPress->settings['iTunesAuthor'])) { 115 $data['author'] = $podPress->settings['iTunesAuthor']; 116 } else { 117 $data['author'] = get_option('blogname'); 114 if (0 >= strlen(trim($data['author']))) { 115 if (0 < strlen($podPress->settings['iTunesAuthor'])) { 116 $data['author'] = $podPress->settings['iTunesAuthor']; 117 } else { 118 $data['author'] = get_option('blogname'); 119 } 118 120 } 119 121 } 120 122 if (TRUE == empty($podPress->settings['rss_category'])) { … … 127 129 if(!empty($data['rss_ttl']) && $data['rss_ttl'] < 1440) { 128 130 $data['rss_ttl'] = 1440; 129 131 } 130 echo ' <!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - ->'."\n";132 echo ' <!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n"; 131 133 if (empty($data['rss_copyright'])) { 132 134 echo ' <copyright>'.podPress_feedSafeContent(__('Copyright', 'podpress').' © '. date('Y',time())).' '.get_bloginfo('blogname').' '.$podPress->settings['rss_license_url'].'</copyright>'."\n"; 133 135 } else { … … 265 267 if(!isset($podPress->settings['category_data'])) { 266 268 podPress_feed_getCategory(); 267 269 } 268 echo "\t".'<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" -->'."\n";270 echo '<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" - maintenance_release="'.PODPRESS_MAINTENANCE_VERSION.'" -->'."\n"; 269 271 if ($podPress->settings['category_data']['categoryCasting'] == 'true' && $podPress->settings['category_data']['rss_imageChoice'] == 'Custom') { 270 272 echo "\t".'<logo>'.podPress_feedSafeContent($podPress->settings['category_data']['rss_image']).'</logo>'."\n"; 271 273 } else { 272 274 echo "\t".'<logo>'.podPress_feedSafeContent(get_option('rss_image')).'</logo>'."\n"; 273 275 } 274 if ( !empty($podPress->settings['rss_copyright']) ) {275 echo "\t".'<rights>'.$podPress->settings['rss_copyright'].'</rights>'."\n";276 }277 276 if (empty($data['rss_copyright'])) { 278 277 echo ' <rights>'.podPress_feedSafeContent(__('Copyright', 'podpress').' © '. date('Y',time())).' '.get_bloginfo('blogname').'</rights>'."\n"; 279 278 } else { … … 428 427 $post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToValidWebPath($post->podPressMedia[$key]['URI']); 429 428 if (podPress_getFileExt($post->podPressMedia[$key]['URI']) == 'mp3') { 430 429 $result .= "\t"."\t"."\t".'<location>'.$post->podPressMedia[$key]['URI']."</location>\n"; 431 if (!empty($post->podPressMedia[$key]['title'])) {430 if (!empty($post->podPressMedia[$key]['title'])) { 432 431 $result .= "\t"."\t"."\t".'<annotation>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</annotation>\n"; 433 432 $result .= "\t"."\t"."\t".'<title>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</title>\n"; 434 433 } else {
