- Timestamp:
- May 29, 2010, 2:46:22 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/extras/wp_plugin/xpressme-backup/xpressme-backup.php
r608 r610 158 158 $before_prefix = $_POST['before_prefix']; 159 159 $after_prefix = $_POST['after_prefix']; 160 161 update_option('xpressme_backup_extras_option', array('do_euc_to_utf8' => $do_euc_to_utf8, 'do_rename_prefix' => $do_rename_prefix, 'before_prefix' => $before_prefix, 'after_prefix' => $after_prefix)); 160 $do_change_uri = $_POST['do_change_uri']; 161 $before_uri = $_POST['before_uri']; 162 $after_uri = $_POST['after_uri']; 163 164 update_option('xpressme_backup_extras_option', 165 array('do_euc_to_utf8' => $do_euc_to_utf8, 166 'do_rename_prefix' => $do_rename_prefix, 167 'before_prefix' => $before_prefix, 168 'after_prefix' => $after_prefix, 169 'do_change_uri' => $do_change_uri, 170 'before_uri' => $before_uri, 171 'after_uri' => $after_uri 172 ) 173 ); 162 174 163 175 switch($_POST['do_backup']) { … … 1287 1299 <input type="text" name="after_prefix" size="20" value="<?php echo $table_prefix; ?>" /> 1288 1300 </label></li> 1301 <li><label for="change_uri"> 1302 <input type="checkbox" name="do_change_uri" id="do_change_uri" value="1" /> 1303 <?php $site_uri = get_option('siteurl');?> 1304 <?php _e('Change URL','xpressme-backup'); ?> 1305 <div style="padding-left: 20px;"> 1306 <input type="text" name="before_uri" size="50" value="<?php echo $site_uri; ?>" /><br /> 1307 <?php _e('to','xpressme-backup'); ?><br /> 1308 <input type="text" name="after_uri" size="50" value="<?php echo $site_uri; ?>" /> 1309 </div> 1310 </label></li> 1289 1311 </ul> 1290 1312 <?php if ( ! $whoops ) : ?> … … 1491 1513 if ($extras_option['do_euc_to_utf8'] && $this->is_mbstring()){ 1492 1514 $query_line = mb_convert_encoding(mb_convert_encoding($query_line,"sjis-win","EUC-JP"),"UTF-8","sjis-win"); 1493 $tmp = preg_replace('/DEFAULT\s*CHARSET\s*=\s*ujis/','DEFAULT CHARSET=utf -8',$query_line);1515 $tmp = preg_replace('/DEFAULT\s*CHARSET\s*=\s*ujis/','DEFAULT CHARSET=utf8',$query_line); 1494 1516 if (empty($buf)) $query_line = $tmp; 1495 1517 if (preg_match_all('/s:([0-9]+):"(.*?)";/',$query_line,$matchs)){ … … 1538 1560 } 1539 1561 } 1562 if ($extras_option['do_change_uri']){ 1563 if (!empty($extras_option['before_uri']) && !empty($extras_option['after_uri'])){ 1564 $org = $extras_option['before_uri']; 1565 $org = str_replace('/','\\/',$org); 1566 $src = '/' . $org . '/'; 1567 $dist = $extras_option['after_uri']; 1568 if(preg_match($src,$query_line)){ 1569 $query_line = preg_replace($src,$dist,$query_line); 1570 } 1571 } 1572 } 1540 1573 return $query_line; 1541 1574 }
Note: See TracChangeset
for help on using the changeset viewer.