WordPress.org

Make WordPress Core

Changeset 38710


Ignore:
Timestamp:
10/03/16 18:12:57 (14 months ago)
Author:
obenland
Message:

Themes: Account for uppercase chars when managing themes.

Fixes a bug where the UI wasn't updated after deleting/updating a theme.

Also introduces unit tests for theme management ajax handlers. For now they're
focused on wp_ajax_update_theme() but they can include tests for other
handlers as well.

Props chrisjean for initial patch.
Fixes #37924.

Location:
trunk
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r38704 r38710  
    34063406    } 
    34073407 
    3408     $stylesheet = sanitize_key( wp_unslash( $_POST['slug'] ) ); 
     3408    $stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) ); 
    34093409    $status     = array( 
    34103410        'update'     => 'theme', 
     
    34913491    } 
    34923492 
    3493     $stylesheet = sanitize_key( wp_unslash( $_POST['slug'] ) ); 
     3493    $stylesheet = preg_replace( '/[^A-z0-9_\-]/', '', wp_unslash( $_POST['slug'] ) ); 
    34943494    $status     = array( 
    34953495        'delete' => 'theme', 
Note: See TracChangeset for help on using the changeset viewer.