Permalink
Browse files

PHP 5.4 / The new JIT behavior for GLOBALS requires us to explicitly …

…declare globals even if we were grabbing them through the array. Meh.
  • Loading branch information...
Charles Johnson
Charles Johnson committed May 4, 2013
1 parent a22e89f commit ff9d9ab3cac77da8c2c562896c5a15153e0ec04f
View
@@ -366,8 +366,9 @@ function display_feed_select_dropdown() {
} /* FeedWordPressAdminPage::display_feed_select_dropdown() */
function display_sheet_header ($pagename = 'Syndication', $all = false) {
global $fwp_path;
?>
<div class="icon32"><img src="<?php print esc_html(WP_PLUGIN_URL.'/'.$GLOBALS['fwp_path'].'/feedwordpress.png'); ?>" alt="" /></div>
<div class="icon32"><img src="<?php print esc_html(WP_PLUGIN_URL.'/'.$fwp_path.'/feedwordpress.png'); ?>" alt="" /></div>
<h2><?php print esc_html(__($pagename.($all ? '' : ' Settings'))); ?><?php if ($this->for_feed_settings()) : ?>: <?php echo esc_html($this->link->name(/*from feed=*/ false)); ?><?php endif; ?></h2>
<?php
}
@@ -424,6 +425,8 @@ function update_message () {
}
function display () {
global $fwp_post;
if (FeedWordPress::needs_upgrade()) :
fwp_upgrade_page();
return;
@@ -435,7 +438,7 @@ function display () {
// Process POST request, if any ////////////////
////////////////////////////////////////////////
if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') :
$this->accept_POST($GLOBALS['fwp_post']);
$this->accept_POST($fwp_post);
else :
$this->updated = false;
endif;
View
@@ -177,7 +177,7 @@ function fwp_time_elapsed ($ts) {
################################################################################
function fwp_upgrade_page () {
if (isset($GLOBALS['fwp_post']['action']) and $GLOBALS['fwp_post']['action']=='Upgrade') :
if (MyPHP::post('action')=='Upgrade') :
$ver = get_option('feedwordpress_version');
if (get_option('feedwordpress_version') != FEEDWORDPRESS_VERSION) :
echo "<div class=\"wrap\">\n";
View
@@ -28,7 +28,7 @@ function display () {
if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') :
$this->accept_POST($fwp_post);
do_action('feedwordpress_admin_page_diagnostics_save', $GLOBALS['fwp_post'], $this);
do_action('feedwordpress_admin_page_diagnostics_save', $fwp_post, $this);
endif;
////////////////////////////////////////////////
View
@@ -3,15 +3,15 @@
Plugin Name: FeedWordPress
Plugin URI: http://feedwordpress.radgeek.com/
Description: simple and flexible Atom/RSS syndication for WordPress
Version: 2013.0502
Version: 2013.0504
Author: Charles Johnson
Author URI: http://radgeek.com/
License: GPL
*/
/**
* @package FeedWordPress
* @version 2013.0502
* @version 2013.0504
*/
# This uses code derived from:
@@ -32,7 +32,7 @@
# -- Don't change these unless you know what you're doing...
define ('FEEDWORDPRESS_VERSION', '2013.0502');
define ('FEEDWORDPRESS_VERSION', '2013.0504');
define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact');
if (!defined('FEEDWORDPRESS_BLEG')) :
@@ -794,14 +794,15 @@ function fwp_publish_post_hook ($post_id) {
function feedwordpress_add_post_edit_controls () {
global $feedwordpress;
global $inspectPostMeta;
// Put in Manual Editing checkbox
add_meta_box('feedwordpress-post-controls', __('Syndication'), 'feedwordpress_post_edit_controls', 'post', 'side', 'high');
add_filter('user_can_richedit', array($feedwordpress, 'user_can_richedit'), 1000, 1);
if (FeedWordPress::diagnostic_on('syndicated_posts:static_meta_data')) :
$GLOBALS['inspectPostMeta'] = new InspectPostMeta;
$inspectPostMeta = new InspectPostMeta;
endif;
} // function FeedWordPress::postEditControls
@@ -1,5 +1,7 @@
<?php
$GLOBALS['fwp_credentials'] = NULL;
global $fwp_credentials;
$fwp_credentials = NULL;
class FeedWordPress_File extends WP_SimplePie_File {
function FeedWordPress_File ($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
@@ -91,7 +91,8 @@ public function syndication_permalink () {
}
public function feed () {
return $GLOBALS['feedwordpress']->subscription($this->feed_id());
global $feedwordpress;
return $feedwordpress->subscription($this->feed_id());
}
public function feed_id () {
@@ -431,7 +431,7 @@ function dashboard_box ($page, $box = NULL) {
// Hey ho, let's go...
?>
<div style="float: left; background: #F5F5F5; padding-top: 5px; padding-right: 5px;"><a href="<?php print $this->form_action(); ?>"><img src="<?php print esc_html(WP_PLUGIN_URL.'/'.$GLOBALS['fwp_path'].'/feedwordpress.png'); ?>" alt="" /></a></div>
<div style="float: left; background: #F5F5F5; padding-top: 5px; padding-right: 5px;"><a href="<?php print $this->form_action(); ?>"><img src="<?php print esc_html(WP_PLUGIN_URL."/${fwp_path}/feedwordpress.png"); ?>" alt="" /></a></div>
<p class="info" style="margin-bottom: 0px; border-bottom: 1px dotted black;">Managed by <a href="http://feedwordpress.radgeek.com/">FeedWordPress</a>
<?php print FEEDWORDPRESS_VERSION; ?>.</p>
@@ -695,21 +695,20 @@ function interstitial () {
function multidelete_page () {
global $wpdb;
global $fwp_post;
// If this is a POST, validate source and user credentials
FeedWordPressCompatibility::validate_http_request(/*action=*/ 'feedwordpress_feeds', /*capability=*/ 'manage_links');
if (isset($fwp_post['submit']) and $fwp_post['submit']==FWP_CANCEL_BUTTON) :
if (MyPHP::post('submit')==FWP_CANCEL_BUTTON) :
return true; // Continue without further ado.
endif;
$link_ids = (isset($_REQUEST['link_ids']) ? $_REQUEST['link_ids'] : array());
if (isset($_REQUEST['link_id'])) : array_push($link_ids, $_REQUEST['link_id']); endif;
if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm']=='Delete'):
if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) :
$actions = $GLOBALS['fwp_post']['link_action'];
if (MyPHP::post('confirm')=='Delete'):
if ( is_array(MyPHP::post('link_action')) ) :
$actions = MyPHP::post('link_action');
else :
$actions = array();
endif;
@@ -875,9 +874,9 @@ function multiundelete_page () {
$link_ids = (isset($_REQUEST['link_ids']) ? $_REQUEST['link_ids'] : array());
if (isset($_REQUEST['link_id'])) : array_push($link_ids, $_REQUEST['link_id']); endif;
if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm']=='Undelete'):
if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) :
$actions = $GLOBALS['fwp_post']['link_action'];
if (MyPHP::post('confirm')=='Undelete'):
if ( is_array(MyPHP::post('link_action')) ) :
$actions = MyPHP::post('link_action');
else :
$actions = array();
endif;
@@ -1117,7 +1116,7 @@ function fwp_feedfinder_page () {
function fwp_switchfeed_page () {
global $wpdb, $wp_db_version;
global $fwp_post;
global $fwp_post, $fwp_path;
// If this is a POST, validate source and user credentials
FeedWordPressCompatibility::validate_http_request(/*action=*/ 'feedwordpress_switchfeed', /*capability=*/ 'manage_links');
@@ -1134,7 +1133,7 @@ function fwp_switchfeed_page () {
<div class="updated"><p><a href="<?php print $fwp_post['feed_link']; ?>"><?php print esc_html($fwp_post['feed_title']); ?></a>
has been added as a contributing site, using the feed at
&lt;<a href="<?php print $fwp_post['feed']; ?>"><?php print esc_html($fwp_post['feed']); ?></a>&gt;.
| <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/feeds-page.php&amp;link_id=<?php print $link_id; ?>">Configure settings</a>.</p></div>
| <a href="admin.php?page=<?php print $fwp_path; ?>/feeds-page.php&amp;link_id=<?php print $link_id; ?>">Configure settings</a>.</p></div>
<?php else: ?>
<div class="updated"><p>There was a problem adding the feed. [SQL: <?php echo esc_html(mysql_error()); ?>]</p></div>
<?php endif;
View
@@ -25,7 +25,7 @@ function display () {
if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') :
$this->accept_POST($fwp_post);
do_action('feedwordpress_admin_page_performance_save', $GLOBALS['fwp_post'], $this);
do_action('feedwordpress_admin_page_performance_save', $fwp_post, $this);
endif;
////////////////////////////////////////////////

0 comments on commit ff9d9ab

Please sign in to comment.