Plugin Directory

Changeset 968440


Ignore:
Timestamp:
08/19/2014 06:07:16 PM (11 years ago)
Author:
pmtarantino
Message:

Bug fix: Images in post were linked to the original blog.

Location:
multisite-cloner/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • multisite-cloner/trunk/multisite-cloner.php

    r960134 r968440  
    55 * Plugin URI: https://wordpress.org/plugins/multisite-cloner
    66 * Description: When creating a new blog on WordPress Multisite, copies all the posts, settings and files, from a selected blog into the new one.
    7  * Version: 0.1.8
     7 * Version: 0.1.9
    88 * Author: Manuel Razzari, Patricio Tarantino
    99 * Author URI: http://tipit.net
     
    209209
    210210        // Replace URLs and paths in the DB
    211        
     211
    212212        cloner_db_replacer( array($old_url,$old_uploads), array($new_url,$new_uploads), $new_tables);
    213213
     
    219219
    220220        // Copy Files
    221         $old_uploads = str_ireplace($blog_id, $id_default_blog, $base_dir);;
     221        $old_uploads = str_ireplace($blog_id, $id_default_blog, $base_dir);
    222222        $new_uploads = $base_dir;;
    223223
     
    381381
    382382                        // Something was changed
    383                         if ( $edited_data != $data_to_fix ) {
    384                             $update_sql[] = $column . ' = "' . ( $edited_data ) . '"';
     383                        if ( $edited_data != $data_to_fix) {
     384                            $update_sql[] = $column . ' = "' . mysql_real_escape_string( $edited_data ) . '"';
    385385                            $upd = true;
    386386                        }
    387 
    388387                        if ( $primary_key )
    389                             $where_sql[] = $column . ' = "' . ( $data_to_fix ) . '"';
     388                            $where_sql[] = $column . ' = "' . mysql_real_escape_string( $data_to_fix ) . '"';
    390389                    }
    391390
    392                     if ( $upd && ! empty( $where_sql ) ) {
     391                    if ( $upd && ! empty( $where_sql )) {
    393392                        $sql = 'UPDATE ' . $table . ' SET ' . implode( ', ', $update_sql ) . ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) );
    394                         $result = $wpdb->query( $sql );
    395    
     393                        $result = $wpdb->query( $sql );   
    396394                    }
    397395
     396
    398397                }
    399398
    400399            }
     400
    401401        }
    402402
  • multisite-cloner/trunk/readme.txt

    r960134 r968440  
    6262== Changelog ==
    6363
     64= 0.1.9 =
     65* Bug fix: Images in post were linked to the original blog.
     66
    6467= 0.1.8 =
    6568* Minor fix to avoid PHP warning if target directories already exist (Fixes [warning when creating new site](http://wordpress.org/support/topic/error-when-creating-new-site) reported by mr.gengu and beda69).
     
    97100== Upgrade Notice ==
    98101
    99 = 0.1.8 =
    100 * Minor fix to avoid PHP warning if target directories already exist.
     102= 0.1.9 =
     103* Bug fix: Images in post were linked to the original blog.
Note: See TracChangeset for help on using the changeset viewer.