XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 30, 2010, 7:12:20 PM (14 years ago)
Author:
toemon
Message:

WordPressME2.0.1x のuser_lole がWordPress3.0では利用できなくなるバグ修正 ref#385
EUC->UTF-8変換時、例として
[s:24:"管理人 - (Administrator)";]
[s:27:"管理人 - (Administrator)";]のところ
[s:27:"管理人 - (Administrator)"](;が抜けている)になっていたため。
get_optionの後のunserializeでエラーとなっていた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/extras/wp_plugin/xpressme-backup/xpressme-backup.php

    r673 r675  
    161161                        $before_uri = $_POST['before_uri']; 
    162162                        $after_uri = $_POST['after_uri']; 
    163                         $set_default_role = $_POST['set_default_role']; 
    164163                        $del_active_plugin = $_POST['del_active_plugin']; 
    165164                         
     
    172171                                        'before_uri' => $before_uri,  
    173172                                        'after_uri' => $after_uri, 
    174                                         'set_default_role' => $set_default_role, 
    175173                                        'del_active_plugin' => $del_active_plugin 
    176174                                ) 
     
    15561554                                                $src = '/' . $org . '/'; 
    15571555//                                              $dist = '*************************************s:' . $num . '->' . $volm . '"' . $str . '"'; 
    1558                                                 $dist = 's:'. $volm . ':"' . $str . '"'; 
     1556                                                $dist = 's:'. $volm . ':"' . $str . '";'; 
    15591557                                                if(preg_match($src,$query_line)){ 
    15601558                                                        $query_line = preg_replace($src,$dist,$query_line); 
     
    15901588                        } 
    15911589                } 
    1592                 if ($extras_option['set_default_role']){ 
    1593                                 $src = '/' . "(INSERT INTO `.+_options` VALUES \([0-9]+, [0-9]+, '.+_user_roles', 'Y', [0-9]+, ')(a:.+}}})('.+\);)" . '/'; 
    1594                                 if(preg_match($src,$query_line,$matches)){       
    1595                                         $query_line = "\n" . $matches[1] . $this->get_default_usr_role() . $matches[3]; 
    1596                                 }                        
    1597                 } 
     1590                 
    15981591                if ($extras_option['del_active_plugin']){ 
    15991592                                $src = '/' . "(INSERT INTO `.+_options` VALUES \([0-9]+, [0-9]+, 'active_plugins', 'Y', [0-9]+, ')(a:.+})('.+\);)" . '/'; 
     
    16121605                return function_exists('mb_convert_encoding'); 
    16131606        } 
    1614         function get_default_usr_role(){ 
    1615                 $role = 'a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:62:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;s:14:"install_themes";b:1;s:11:"update_core";b:1;s:10:"list_users";b:1;s:12:"remove_users";b:1;s:9:"add_users";b:1;s:13:"promote_users";b:1;s:18:"edit_theme_options";b:1;s:13:"delete_themes";b:1;s:6:"export";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}'; 
    1616                 return $role; 
    1617         } 
    1618  
    16191607} 
    16201608 
Note: See TracChangeset for help on using the changeset viewer.