[wp-trac] [WordPress Trac] #32465: Capital case chars in a plugin slug/name break the autoupdate mechanism.

WordPress Trac noreply at wordpress.org
Fri May 22 15:51:56 UTC 2015


#32465: Capital case chars in a plugin slug/name break the autoupdate mechanism.
-----------------------------+-----------------------------
 Reporter:  caraffande       |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  4.2.2
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 If you use capital letters in a plugin name (such as: MyCoolPlugin), or,
 better said, if your ''plugin's folder's name'' has Uppercase chars in it,
 the update process via the plugins.php page fails.
 If you update the plugin, using the update-core.php page, ''it works
 perfectly'', but if you update/upgrade from somewhere else then the page
 stays indefinitely on the message "Update in progress...".
 More precisely, I have to say that the update process, actually, completes
 successfully. The plugin ''is'' updated. The problem is in the JSON
 response which sends back a "lowerized" slug name.
 My proposal to fix this is to replace
 {{{
         'slug'       => sanitize_key( $_POST['slug'] ),
 }}}
 in the wp_ajax_update_plugins() function of the ajax-actions.php file with
 a more reasonable
 {{{
         'slug'       => preg_replace( '/[^A-Za-z0-9_\-]/', '',
 $_POST['slug'] ),
 }}}

 (If we don't need to "sanitize" the slug in update-core.php then we don't
 need to in plugins.php either, do we?)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32465>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list