WordPress.org

Plugin Directory

Changeset 496815


Ignore:
Timestamp:
01/29/12 09:39:26 (2 years ago)
Author:
sivel
Message:

Apparently in a LIKE query, an underscore matches a single character, so we must escape it

Location:
wordpress-reset/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wordpress-reset/trunk/readme.txt

    r496738 r496815  
    5454== Upgrade Notice == 
    5555 
    56 = 1.3 = 
     56= 1.3.1 = 
    5757 
    5858Fixes a deprecated notice in WordPress 3.3, removed the $auto_reactivate variable, and look for REACTIVATE_WP_RESET to be defined in wp-config.php, as well as the ability to activate additional plugins using a global $reactivate_wp_reset_additional array defined in wp-config.php 
    5959 
    6060== Changelog == 
     61 
     62= 1.3.1 (2012-01-29): = 
     63* Apparently in a LIKE query, an underscore matches a single character, so we must escape it 
    6164 
    6265= 1.3 (2012-01-29): = 
  • wordpress-reset/trunk/wordpress-reset.php

    r496737 r496815  
    55Description: Resets the WordPress database back to it's defaults. Deletes all customizations and content. Does not modify files only resets the database. 
    66Author: Matt Martz 
    7 Version: 1.3 
     7Version: 1.3.1 
    88Author URI: http://sivel.net/ 
    99 
     
    7171 
    7272            global $wpdb, $reactivate_wp_reset_additional; 
    73             $tables = $wpdb->get_col( "SHOW TABLES LIKE '{$wpdb->prefix}%'" ); 
     73 
     74            $prefix = str_replace( '_', '\_', $wpdb->prefix ); 
     75            $tables = $wpdb->get_col( "SHOW TABLES LIKE '{$prefix}%'" ); 
    7476            foreach ( $tables as $table ) { 
    7577                $wpdb->query( "DROP TABLE $table" ); 
Note: See TracChangeset for help on using the changeset viewer.