Ticket #12260: patch.diff
File patch.diff, 2.1 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/update.php
171 171 add_action( 'admin_init', 'wp_plugin_update_rows' ); 172 172 173 173 function wp_plugin_update_row( $file, $plugin_data ) { 174 174 175 $current = get_transient( 'update_plugins' ); 175 176 if ( !isset( $current->response[ $file ] ) ) 176 177 return false; 177 178 178 179 $r = $current->response[ $file ]; 180 $php_version = phpversion(); 181 $php_compat = version_compare( $php_version, $r->required_php, '>=' ); 179 182 180 183 $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); 181 184 $plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags ); … … 187 190 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 188 191 else if ( empty($r->package) ) 189 192 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 193 else if (!$php_compat) 194 printf( __('There is a new version of %1$s available. You cannot upgrade because the upgrade requires PHP version %2$s or higher. You are running version %3$s. <a href="%4$s" class="thickbox" title="53$s">View version %6$s Details</a>.'), $plugin_name, $r->php, $php_version, esc_url($details_url), esc_attr($plugin_name), $r->new_version) ; 190 195 else 191 196 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> or <a href="%5$s">upgrade automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $file, 'upgrade-plugin_' . $file) ); 192 197