WordPress.org

Plugin Directory

Changeset 707986 for feedwordpress


Ignore:
Timestamp:
05/04/13 20:22:58 (4 years ago)
Author:
radgeek
Message:

PHP 5.4 / The new JIT behavior for GLOBALS superglobal array requires us to explicitly declare globals even if we were grabbing them through the array. Compatibility fix to match this expectation.

Location:
feedwordpress/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/admin-ui.php

    r707978 r707986  
    250250        // If there is a link ID provided, then merge that in too. 
    251251        if (!is_null($link)) : 
     252            $link_id = NULL; 
    252253            if (is_object($link)) : 
    253                 $link_id = $link->link_id; 
     254                if (method_exists($link, 'found')) : 
     255                    // Is this a SyndicatedLink object?                  
     256                    if ($link->found()) : 
     257                        $link_id = $link->link->link_id; 
     258                    endif; 
     259                else : 
     260                    // Is this a wp_links table record? 
     261                    $link_id = $link->link_id; 
     262                endif; 
    254263            else : 
     264                // Is this just a numeric ID? 
    255265                $link_id = $link; 
    256266            endif; 
    257267 
    258             $params = array_merge($params, array('link_id' => $link_id)); 
    259         endif; 
    260  
    261         return MyPHP::url('admin.php', $params); 
     268            if (!is_null($link_id)) : 
     269                $params = array_merge($params, array('link_id' => $link_id)); 
     270            endif; 
     271        endif; 
     272 
     273        return MyPHP::url(admin_url('admin.php'), $params); 
    262274    } /* FeedWordPressAdminPage::admin_page_href () */ 
    263275 
     
    281293        ); 
    282294         
    283         $hrefPrefix = 'admin.php?'; 
    284          
    285295        $link_id = NULL; 
    286296        if (is_object($sub)) : 
     
    294304        endif; 
    295305         
    296         if (!is_null($link_id)) : 
    297             $urlParam = "link_id={$link_id}"; 
    298             $hrefPrefix .= $urlParam."&"; 
    299             $urlSuffix = "&".$urlParam; 
    300         else : 
    301             $urlParam = ''; 
    302         endif; 
    303         $hrefPrefix .= "page=${fwp_path}/"; 
    304          
    305306        print $params['before']; $first = true; 
    306307        foreach ($links as $label => $link) : 
    307308            if (!$first) :  print $params['between']; endif; 
    308309             
    309             if (isset($link['url'])) : $url = $link['url'].$urlSuffix; 
    310             else : $url = $hrefPrefix.$link['page']; 
     310            if (isset($link['url'])) : MyPHP::url($link['url'], array("link_id" => $link_id)); 
     311            else : $url = $this->admin_page_href($link['page'], array(), $sub); 
    311312            endif; 
    312313            $url = esc_html($url); 
     
    10961097 
    10971098function fwp_syndication_manage_page_links_table_rows ($links, $page, $visible = 'Y') { 
    1098     global $fwp_path; 
    10991099     
    11001100    $subscribed = ('Y' == strtoupper($visible)); 
     
    12071207    <th class="check-column" scope="row"><input type="checkbox" name="link_ids[]" value="<?php echo $link->link_id; ?>" /></th> 
    12081208                <?php 
    1209                 $hrefPrefix = "admin.php?link_id={$link->link_id}&amp;page=${fwp_path}/"; 
    12101209                $caption = ( 
    12111210                    (strlen($link->link_rss) > 0) 
     
    12151214                ?> 
    12161215    <td> 
    1217     <strong><a href="<?php print $this->admin_page_href('feeds-page.php', array(), $link); ?>"><?php print esc_html($link->link_name); ?></a></strong> 
     1216    <strong><a href="<?php print $page->admin_page_href('feeds-page.php', array(), $link); ?>"><?php print esc_html($link->link_name); ?></a></strong> 
    12181217    <div class="row-actions"><?php if ($subscribed) : 
    12191218        $page->display_feed_settings_page_links(array( 
     
    12261225    <div><strong>Actions &gt;</strong> 
    12271226    <?php if ($subscribed) : ?> 
    1228     <a href="<?php print $hrefPrefix; ?>syndication.php&amp;action=feedfinder"><?php echo $caption; ?></a> 
     1227    <a href="<?php print $page->admin_page_href('syndication.php', array('action' => 'feedfinder'), $link); ?>"><?php echo $caption; ?></a> 
    12291228    <?php else : ?> 
    1230     <a href="<?php print $hrefPrefix; ?>syndication.php&amp;action=<?php print FWP_RESUB_CHECKED; ?>"><?php _e('Re-subscribe'); ?></a> 
     1229    <a href="<?php print $page->admin_page_href('syndication.php', array('action' => FWP_RESUB_CHECKED), $link); ?>"><?php _e('Re-subscribe'); ?></a> 
    12311230    <?php endif; ?> 
    1232     | <a href="<?php print $hrefPrefix; ?>syndication.php&amp;action=Unsubscribe"><?php _e(($subscribed ? 'Unsubscribe' : 'Delete permanently')); ?></a> 
     1231    | <a href="<?php print $page->admin_page_href('syndication.php', array('action' => 'Unsubscribe'), $link); ?>"><?php _e(($subscribed ? 'Unsubscribe' : 'Delete permanently')); ?></a> 
    12331232    | <a href="<?php print esc_html($link->link_url); ?>"><?php _e('View')?></a></div> 
    12341233    </div> 
     
    12631262} /* function fwp_syndication_manage_page_links_table_rows () */ 
    12641263 
    1265 function fwp_syndication_manage_page_links_subsubsub ($sources, $showInactive) { 
    1266     global $fwp_path; 
    1267     $hrefPrefix = "admin.php?page=${fwp_path}/syndication.php"; 
    1268     ?> 
    1269     <ul class="subsubsub"> 
    1270     <li><a <?php if (!$showInactive) : ?>class="current" <?php endif; ?>href="<?php print $hrefPrefix; ?>&amp;visibility=Y">Subscribed 
    1271     <span class="count">(<?php print count($sources['Y']); ?>)</span></a></li> 
    1272     <?php if ($showInactive or (count($sources['N']) > 0)) : ?> 
    1273     <li><a <?php if ($showInactive) : ?>class="current" <?php endif; ?>href="<?php print $hrefPrefix; ?>&amp;visibility=N">Inactive</a> 
    1274     <span class="count">(<?php print count($sources['N']); ?>)</span></a></li> 
    1275     <?php endif; ?> 
    1276  
    1277     </ul> <!-- class="subsubsub" --> 
    1278     <?php 
    1279 } 
    1280  
  • feedwordpress/trunk/compatability.php

    r549640 r707986  
    178178 
    179179function fwp_upgrade_page () { 
    180     if (isset($GLOBALS['fwp_post']['action']) and $GLOBALS['fwp_post']['action']=='Upgrade') : 
     180    if (MyPHP::post('action')=='Upgrade') : 
    181181        $ver = get_option('feedwordpress_version'); 
    182182        if (get_option('feedwordpress_version') != FEEDWORDPRESS_VERSION) : 
  • feedwordpress/trunk/diagnostics-page.php

    r681367 r707986  
    2929        if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') : 
    3030            $this->accept_POST($fwp_post); 
    31             do_action('feedwordpress_admin_page_diagnostics_save', $GLOBALS['fwp_post'], $this); 
     31            do_action('feedwordpress_admin_page_diagnostics_save', $fwp_post, $this); 
    3232        endif; 
    3333 
  • feedwordpress/trunk/feeds-page.php

    r680650 r707986  
    712712 
    713713    function custom_settings_box ($page, $box = NULL) { 
     714        $postsSettings = $this->admin_page_href('posts-page.php', array(), $page->link); 
    714715        ?> 
    715716    <p class="setting-description">These custom settings are special fields for the <strong>feed</strong> you are 
    716717    syndicating, to be retrieved in templates using the <code>get_feed_meta()</code> function. They do not create 
    717718    custom fields on syndicated <strong>posts</strong>. If you want to create custom fields that are applied to each 
    718     individual post from this feed, set up the settings in <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/posts-page.php&amp;link_id=<?php print $page->link->id; ?>">Syndicated Posts</a>.</p> 
     719    individual post from this feed, set up the settings in <a href="<?php print $postsSettings; ?>">Syndicated Posts</a>.</p> 
    719720     
    720721    <div id="postcustomstuff"> 
     
    901902                endif; 
    902903                ?> 
    903                     <form<?php print $form_class; ?> action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/syndication.php" method="post"> 
     904                    <form<?php print $form_class; ?> action="<?php $this->form_action('syndication.php'); ?>" method="post"> 
    904905                    <div class="inside"><?php FeedWordPressCompatibility::stamp_nonce('feedwordpress_switchfeed'); ?> 
    905906 
     
    10691070         
    10701071        ?> 
    1071         <form action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>" method="post"> 
     1072        <form action="<?php $this->form_action(); ?>" method="post"> 
    10721073        <div class="inside"><?php 
    10731074            FeedWordPressCompatibility::stamp_nonce($this->dispatch); 
  • feedwordpress/trunk/feedwordpress.php

    r707027 r707986  
    44Plugin URI: http://feedwordpress.radgeek.com/ 
    55Description: simple and flexible Atom/RSS syndication for WordPress 
    6 Version: 2013.0502 
     6Version: 2013.0504 
    77Author: Charles Johnson 
    88Author URI: http://radgeek.com/ 
     
    1212/** 
    1313 * @package FeedWordPress 
    14  * @version 2013.0502 
     14 * @version 2013.0504 
    1515 */ 
    1616 
     
    3333# -- Don't change these unless you know what you're doing... 
    3434 
    35 define ('FEEDWORDPRESS_VERSION', '2013.0502'); 
     35define ('FEEDWORDPRESS_VERSION', '2013.0504'); 
    3636define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact'); 
    3737 
     
    795795    function feedwordpress_add_post_edit_controls () { 
    796796        global $feedwordpress; 
    797          
     797        global $inspectPostMeta; 
     798 
    798799        // Put in Manual Editing checkbox 
    799800        add_meta_box('feedwordpress-post-controls', __('Syndication'), 'feedwordpress_post_edit_controls', 'post', 'side', 'high'); 
     
    802803         
    803804        if (FeedWordPress::diagnostic_on('syndicated_posts:static_meta_data')) : 
    804             $GLOBALS['inspectPostMeta'] = new InspectPostMeta; 
     805            $inspectPostMeta = new InspectPostMeta; 
    805806        endif; 
    806807    } // function FeedWordPress::postEditControls 
  • feedwordpress/trunk/feedwordpress_file.class.php

    r707027 r707986  
    11<?php 
    2 $GLOBALS['fwp_credentials'] = NULL; 
     2global $fwp_credentials; 
     3 
     4$fwp_credentials = NULL; 
    35 
    46class FeedWordPress_File extends WP_SimplePie_File { 
  • feedwordpress/trunk/feedwordpresssyndicationpage.class.php

    r680650 r707986  
    432432        // Hey ho, let's go... 
    433433        ?> 
    434         <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> 
     434        <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> 
    435435 
    436436        <p class="info" style="margin-bottom: 0px; border-bottom: 1px dotted black;">Managed by <a href="http://feedwordpress.radgeek.com/">FeedWordPress</a> 
     
    568568        <?php 
    569569        if (count($sources[$visibility]) > 0) : 
    570             fwp_syndication_manage_page_links_subsubsub($sources, $showInactive); 
     570            $this->manage_page_links_subsubsub($sources, $showInactive); 
    571571        endif; 
    572572        ?> 
     
    591591            $this->display_button_bar($showInactive); 
    592592        else : 
    593         ?> 
    594             <?php fwp_syndication_manage_page_links_subsubsub($sources, $showInactive); ?> 
    595         <?php 
     593            $this->manage_page_links_subsubsub($sources, $showInactive); 
    596594        endif; 
    597595         
     
    602600        <?php 
    603601    } /* FeedWordPressSyndicationPage::syndicated_sources_box() */ 
    604      
     602 
     603    function manage_page_links_subsubsub ($sources, $showInactive) { 
     604        $hrefPrefix = $this->admin_page_href("syndication.php"); 
     605?> 
     606    <ul class="subsubsub"> 
     607    <li><a <?php if (!$showInactive) : ?>class="current" <?php endif; ?>href="<?php print $hrefPrefix; ?>&amp;visibility=Y">Subscribed 
     608    <span class="count">(<?php print count($sources['Y']); ?>)</span></a></li> 
     609    <?php if ($showInactive or (count($sources['N']) > 0)) : ?> 
     610    <li><a <?php if ($showInactive) : ?>class="current" <?php endif; ?>href="<?php print $hrefPrefix; ?>&amp;visibility=N">Inactive</a> 
     611    <span class="count">(<?php print count($sources['N']); ?>)</span></a></li> 
     612    <?php endif; ?> 
     613 
     614    </ul> <!-- class="subsubsub" --> 
     615<?php 
     616    } 
     617 
    605618    function display_button_bar ($showInactive) { 
    606619        ?> 
     
    651664<input type="hidden" name="item_name" value="FeedWordPress donation"  /> 
    652665<input type="hidden" name="no_shipping" value="1"  /> 
    653 <input type="hidden" name="return" value="<?php print admin_url('admin.php'); ?>?page=<?php print $GLOBALS['fwp_path'] ?>/<?php print basename($this->filename); ?>&amp;paid=yes"  /> 
     666<input type="hidden" name="return" value="<?php print esc_attr($this->admin_page_href(basename($this->filename), array('paid' => 'yes'))); ?>"  /> 
    654667<input type="hidden" name="currency_code" value="USD" /> 
    655668<input type="hidden" name="notify_url" value="http://feedwordpress.radgeek.com/ipn/donation"  /> 
     
    683696    function multidelete_page () { 
    684697        global $wpdb; 
    685         global $fwp_post; 
    686698         
    687699        // If this is a POST, validate source and user credentials 
    688700        FeedWordPressCompatibility::validate_http_request(/*action=*/ 'feedwordpress_feeds', /*capability=*/ 'manage_links'); 
    689701     
    690         if (isset($fwp_post['submit']) and $fwp_post['submit']==FWP_CANCEL_BUTTON) : 
     702        if (MyPHP::post('submit')==FWP_CANCEL_BUTTON) : 
    691703            return true; // Continue without further ado. 
    692704        endif; 
     
    695707        if (isset($_REQUEST['link_id'])) : array_push($link_ids, $_REQUEST['link_id']); endif; 
    696708     
    697         if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm']=='Delete'): 
    698             if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) : 
    699                 $actions = $GLOBALS['fwp_post']['link_action']; 
     709        if (MyPHP::post('confirm')=='Delete'): 
     710            if ( is_array(MyPHP::post('link_action')) ) : 
     711                $actions = MyPHP::post('link_action'); 
    700712            else : 
    701713                $actions = array(); 
     
    863875        if (isset($_REQUEST['link_id'])) : array_push($link_ids, $_REQUEST['link_id']); endif; 
    864876     
    865         if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm']=='Undelete'): 
    866             if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) : 
    867                 $actions = $GLOBALS['fwp_post']['link_action']; 
     877        if (MyPHP::post('confirm')=='Undelete'): 
     878            if ( is_array(MyPHP::post('link_action')) ) : 
     879                $actions = MyPHP::post('link_action'); 
    868880            else : 
    869881                $actions = array(); 
     
    10691081        <strong>off</strong>. New posts from your feeds will not be syndicated 
    10701082        until you manually check for them here. You can turn on automatic 
    1071         updates under <a href="admin.php?page=<?php print $GLOBALS['fwp_path']; ?>/feeds-page.php">Feed &amp; Update Settings<a></a>.</p> 
     1083        updates under <a href="<?php print $object->admin_page_href('feeds-page.php'); ?>">Feed &amp; Update Settings<a></a>.</p> 
    10721084    <?php  
    10731085    endif; 
     
    11051117function fwp_switchfeed_page () { 
    11061118    global $wpdb, $wp_db_version; 
    1107     global $fwp_post; 
     1119    global $fwp_post, $fwp_path; 
    11081120 
    11091121    // If this is a POST, validate source and user credentials 
     
    11221134has been added as a contributing site, using the feed at 
    11231135&lt;<a href="<?php print $fwp_post['feed']; ?>"><?php print esc_html($fwp_post['feed']); ?></a>&gt;. 
    1124 | <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> 
     1136| <a href="admin.php?page=<?php print $fwp_path; ?>/feeds-page.php&amp;link_id=<?php print $link_id; ?>">Configure settings</a>.</p></div> 
    11251137<?php           else: ?> 
    11261138<div class="updated"><p>There was a problem adding the feed. [SQL: <?php echo esc_html(mysql_error()); ?>]</p></div> 
  • feedwordpress/trunk/performance-page.php

    r547532 r707986  
    2626        if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') : 
    2727            $this->accept_POST($fwp_post); 
    28             do_action('feedwordpress_admin_page_performance_save', $GLOBALS['fwp_post'], $this); 
     28            do_action('feedwordpress_admin_page_performance_save', $fwp_post, $this); 
    2929        endif; 
    3030 
  • feedwordpress/trunk/readme.txt

    r707027 r707986  
    55Requires at least: 3.0 
    66Tested up to: 3.5.1 
    7 Stable tag: 2013.0503 
     7Stable tag: 2013.0504 
    88 
    99FeedWordPress syndicates content from feeds you choose into your WordPress weblog.  
     
    9494 
    9595== Changelog == 
     96 
     97= 2012.0504 = 
     98 
     99*   BUGFIX: PHP 5.4 compatibility -- includes some more extensive fixes to 
     100    compatibility issues with PHP 5.4's handling of global variables 
     101 
     102*   MODULE REORGANIZATION: Should ensures that all needed submodules will be 
     103    properly included regardless of whether you are installing from github, 
     104    from SVN, or from the WordPress plugins page. If you've been getting 
     105    fatal errors about required modules not being found, this release should 
     106    hopefully resolve the issue. 
    96107 
    97108= 2012.0503 = 
Note: See TracChangeset for help on using the changeset viewer.