| @@ -228,9 +228,9 @@ | ||
| 228 | 228 | endif; |
| 229 | 229 | |
| 230 | 230 | shuffle($update_set); // randomize order for load balancing purposes... |
| 231 | 231 | if ($fwp_update_invoke != 'get' and count($update_set) > 0) : // Only do things with side-effects for HTTP POST or command line |
| 232 | - $feedwordpress =& new FeedWordPress; | |
| 232 | + $feedwordpress = new FeedWordPress; | |
| 233 | 233 | add_action('feedwordpress_check_feed', 'update_feeds_mention'); |
| 234 | 234 | add_action('feedwordpress_check_feed_complete', 'update_feeds_finish', 10, 3); |
| 235 | 235 | |
| 236 | 236 | $crash_dt = (int) get_option('feedwordpress_update_time_limit'); |
| @@ -408,9 +408,9 @@ | ||
| 408 | 408 | $caption=__('Find Feed'); |
| 409 | 409 | endif; |
| 410 | 410 | ?> |
| 411 | 411 | <td> |
| 412 | -<strong><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/feeds-page.php&link_id=<?php echo $link->link_id; ?>"><?php echo wp_specialchars($link->link_name, 'both'); ?></a></strong> | |
| 412 | +<strong><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/feeds-page.php&link_id=<?php echo $link->link_id; ?>"><?php echo esc_html($link->link_name); ?></a></strong> | |
| 413 | 413 | <div class="row-actions"><div><strong>Settings ></strong> |
| 414 | 414 | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/feeds-page.php&link_id=<?php echo $link->link_id; ?>"><?php _e('Feed'); ?></a> |
| 415 | 415 | | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/posts-page.php&link_id=<?php echo $link->link_id; ?>"><?php _e('Posts'); ?></a> |
| 416 | 416 | | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/authors-page.php&link_id=<?php echo $link->link_id; ?>"><?php _e('Authors'); ?></a> |
| @@ -417,24 +417,13 @@ | ||
| 417 | 417 | | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/categories-page.php&link_id=<?php echo $link->link_id; ?>"><?php print htmlspecialchars(__('Categories'.FEEDWORDPRESS_AND_TAGS)); ?></a></div> |
| 418 | 418 | <div><strong>Actions ></strong> |
| 419 | 419 | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&link_id=<?php echo $link->link_id; ?>&action=feedfinder"><?php echo $caption; ?></a> |
| 420 | 420 | | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&link_id=<?php echo $link->link_id; ?>&action=Unsubscribe"><?php _e('Unsubscribe'); ?></a> |
| 421 | -| <a href="<?php echo wp_specialchars($link->link_url, 'both'); ?>"><?php _e('View')?></a></div> | |
| 421 | +| <a href="<?php echo esc_html($link->link_url); ?>"><?php _e('View')?></a></div> | |
| 422 | 422 | </div> |
| 423 | 423 | </td> |
| 424 | -<?php | |
| 425 | - if (strlen($link->link_rss) > 0): | |
| 426 | - $uri_bits = parse_url($link->link_rss); | |
| 427 | - $uri_bits['host'] = preg_replace('/^www\./i', '', $uri_bits['host']); | |
| 428 | - $display_uri = | |
| 429 | - (isset($uri_bits['user'])?$uri_bits['user'].'@':'') | |
| 430 | - .(isset($uri_bits['host'])?$uri_bits['host']:'') | |
| 431 | - .(isset($uri_bits['port'])?':'.$uri_bits['port']:'') | |
| 432 | - .(isset($uri_bits['path'])?$uri_bits['path']:'') | |
| 433 | - .(isset($uri_bits['query'])?'?'.$uri_bits['query']:''); | |
| 434 | - if (strlen($display_uri) > 32) : $display_uri = substr($display_uri, 0, 32).'…'; endif; | |
| 435 | -?> | |
| 436 | - <td><a href="<?php echo wp_specialchars($link->link_rss, 'both'); ?>"><?php echo wp_specialchars($display_uri, 'both'); ?></a></td> | |
| 424 | + <?php if (strlen($link->link_rss) > 0): ?> | |
| 425 | + <td><a href="<?php echo esc_html($link->link_rss); ?>"><?php echo esc_html(feedwordpress_display_url($link->link_rss, 32)); ?></a></td> | |
| 437 | 426 | <?php else: ?> |
| 438 | 427 | <td style="background-color:#FFFFD0"><p><strong>no |
| 439 | 428 | feed assigned</strong></p></td> |
| 440 | 429 | <?php endif; ?> |
| @@ -439,9 +428,9 @@ | ||
| 439 | 428 | feed assigned</strong></p></td> |
| 440 | 429 | <?php endif; ?> |
| 441 | 430 | |
| 442 | 431 | <td><?php |
| 443 | - $sLink =& new SyndicatedLink($link->link_id); | |
| 432 | + $sLink = new SyndicatedLink($link->link_id); | |
| 444 | 433 | if (isset($sLink->settings['update/last'])) : |
| 445 | 434 | print fwp_time_elapsed($sLink->settings['update/last']); |
| 446 | 435 | else : |
| 447 | 436 | _e('None yet'); |
| @@ -458,8 +447,9 @@ | ||
| 458 | 447 | endif; |
| 459 | 448 | else: |
| 460 | 449 | echo "as soon as possible"; |
| 461 | 450 | endif; |
| 451 | + unset($sLink); | |
| 462 | 452 | print "</div>"; |
| 463 | 453 | ?> |
| 464 | 454 | </td> |
| 465 | 455 | </tr> |
| @@ -505,15 +495,17 @@ | ||
| 505 | 495 | if (!isset($fwp_post['Cancel'])): |
| 506 | 496 | if (isset($fwp_post['save_link_id']) and ($fwp_post['save_link_id']=='*')) : |
| 507 | 497 | $changed = true; |
| 508 | 498 | $link_id = FeedWordPress::syndicate_link($fwp_post['feed_title'], $fwp_post['feed_link'], $fwp_post['feed']); |
| 509 | - if ($link_id): ?> | |
| 510 | -<div class="updated"><p><a href="<?php print $fwp_post['feed_link']; ?>"><?php print wp_specialchars($fwp_post['feed_title'], 'both'); ?></a> | |
| 499 | + if ($link_id): | |
| 500 | + $existingLink = new SyndicatedLink($link_id); | |
| 501 | + ?> | |
| 502 | +<div class="updated"><p><a href="<?php print $fwp_post['feed_link']; ?>"><?php print esc_html($fwp_post['feed_title']); ?></a> | |
| 511 | 503 | has been added as a contributing site, using the feed at |
| 512 | -<<a href="<?php print $fwp_post['feed']; ?>"><?php print wp_specialchars($fwp_post['feed'], 'both'); ?></a>>. | |
| 504 | +<<a href="<?php print $fwp_post['feed']; ?>"><?php print esc_html($fwp_post['feed']); ?></a>>. | |
| 513 | 505 | | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/feeds-page.php&link_id=<?php print $link_id; ?>">Configure settings</a>.</p></div> |
| 514 | 506 | <?php else: ?> |
| 515 | -<div class="updated"><p>There was a problem adding the feed. [SQL: <?php echo wp_specialchars(mysql_error(), 'both'); ?>]</p></div> | |
| 507 | +<div class="updated"><p>There was a problem adding the feed. [SQL: <?php echo esc_html(mysql_error()); ?>]</p></div> | |
| 516 | 508 | <?php endif; |
| 517 | 509 | elseif (isset($fwp_post['save_link_id'])): |
| 518 | 510 | $existingLink = new SyndicatedLink($fwp_post['save_link_id']); |
| 519 | 511 | $changed = $existingLink->set_uri($fwp_post['feed']); |
| @@ -521,15 +513,19 @@ | ||
| 521 | 513 | if ($changed): |
| 522 | 514 | $home = $existingLink->homepage(/*from feed=*/ false); |
| 523 | 515 | $name = $existingLink->name(/*from feed=*/ false); |
| 524 | 516 | ?> |
| 525 | -<div class="updated"><p>Feed for <a href="<?php echo wp_specialchars($home, 'both'); ?>"><?php echo wp_specialchars($name, 'both'); ?></a> | |
| 526 | -updated to <<a href="<?php echo wp_specialchars($fwp_post['feed'], 'both'); ?>"><?php echo wp_specialchars($fwp_post['feed'], 'both'); ?></a>>.</p></div> | |
| 517 | +<div class="updated"><p>Feed for <a href="<?php echo esc_html($home); ?>"><?php echo esc_html($name); ?></a> | |
| 518 | +updated to <<a href="<?php echo esc_html($fwp_post['feed']); ?>"><?php echo esc_html($fwp_post['feed']); ?></a>>.</p></div> | |
| 527 | 519 | <?php |
| 528 | 520 | endif; |
| 529 | 521 | endif; |
| 530 | 522 | endif; |
| 531 | 523 | |
| 524 | + if (isset($existingLink)) : | |
| 525 | + do_action('feedwordpress_admin_switchfeed', $fwp_post['feed'], $existingLink); | |
| 526 | + endif; | |
| 527 | + | |
| 532 | 528 | if (!$changed) : |
| 533 | 529 | ?> |
| 534 | 530 | <div class="updated"><p>Nothing was changed.</p></div> |
| 535 | 531 | <?php |
| @@ -640,12 +636,12 @@ | ||
| 640 | 636 | <input type="hidden" name="confirm" value="Delete" /> |
| 641 | 637 | |
| 642 | 638 | <h2>Unsubscribe from Syndicated Links:</h2> |
| 643 | 639 | <?php foreach ($targets as $link) : |
| 644 | - $link_url = wp_specialchars($link->link_url, 1); | |
| 645 | - $link_name = wp_specialchars($link->link_name, 1); | |
| 646 | - $link_description = wp_specialchars($link->link_description, 'both'); | |
| 647 | - $link_rss = wp_specialchars($link->link_rss, 'both'); | |
| 640 | + $link_url = esc_html($link->link_url); | |
| 641 | + $link_name = esc_html($link->link_name); | |
| 642 | + $link_description = esc_html($link->link_description); | |
| 643 | + $link_rss = esc_html($link->link_rss); | |
| 648 | 644 | ?> |
| 649 | 645 | <fieldset> |
| 650 | 646 | <legend><?php echo $link_name; ?></legend> |
| 651 | 647 | <table class="editform" width="100%" cellspacing="2" cellpadding="5"> |