[wp-trac] Re: [WordPress Trac] #6248: WP permission issue for plugin updater

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 16 16:59:36 GMT 2008


#6248: WP permission issue for plugin updater
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  anonymous
     Type:  defect             |       Status:  new      
 Priority:  normal             |    Milestone:  2.5      
Component:  Administration     |      Version:  2.5      
 Severity:  normal             |   Resolution:           
 Keywords:                     |  
-------------------------------+--------------------------------------------
Comment (by Denis-de-Bernardy):

 Adding to this one, it would also be sweet to check if the package
 variable of the response is set before suggesting the automated upgrade.


 {{{

 function wp_plugin_update_row( $file ) {
         if ( !( current_user_can('edit_plugins') ||
 current_user_can('administrator') ) ) return;

         global $plugin_data;
         $current = get_option( 'update_plugins' );
         if ( !isset( $current->response[ $file ] ) )
                 return false;

         $r = $current->response[ $file ];

         echo "<tr><td colspan='5' class='plugin-update'>";

 if ( $r->package )
 {
         printf( __('There is a new version of %1$s available. <a
 href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade
 automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version,
 wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file",
 'upgrade-plugin_' . $file) );
 }
 else
 {
         printf( __('There is a new version of %1$s available. <a
 href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'],
 $r->url, $r->new_version );
 }
         echo "</td></tr>";
 }

 }}}


 That way, this plugin will work as expected in its current implementation,
 and its next one:

 http://www.semiologic.com/software/wp-fixes/version-checker/

 Thanks!

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6248#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list