diff --git a/db_structure.php b/db_structure.php index 90b782463..e99cfa308 100644 --- a/db_structure.php +++ b/db_structure.php @@ -360,24 +360,24 @@ foreach ($tables as $keyname => $each_table) { ) { $do = true; } - foreach ($server_slave_Wild_Do_Table as $table) { - if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) + foreach ($server_slave_Wild_Do_Table as $db_table) { + $table_part = PMA_extract_db_or_table($db_table, 'table'); + if (($db == PMA_extract_db_or_table($db_table, 'db')) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { $do = true; + } } //////////////////////////////////////////////////////////////////// if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { $ignored = true; } - foreach ($server_slave_Wild_Ignore_Table as $table) { - if (($db == PMA_replication_strout($table)) && (preg_match("@^" . substr(PMA_replication_strout($table, true), 0, strlen(PMA_replication_strout($table, true)) - 1) . "@", $truename))) + foreach ($server_slave_Wild_Ignore_Table as $db_table) { + $table_part = PMA_extract_db_or_table($db_table, 'table'); + if (($db == PMA_extract_db_or_table($db_table)) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { $ignored = true; + } } - }/* elseif ($server_master_status) { - if ((strlen(array_search($db, $server_master_Do_DB))>0) || count($server_master_Do_DB)==1) - $do = true; - elseif ((strlen(array_search($db, $server_master_Ignore_DB))>0) || count($server_master_Ignore_DB)==1) - $ignored = true; - }*/ + unset($table_part); + } ?> diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php index f2681a668..7b8ca0afb 100644 --- a/libraries/replication.inc.php +++ b/libraries/replication.inc.php @@ -116,14 +116,17 @@ foreach ($replication_types as $type) { /** - * @param $string - - * @param $table - - * @return + * @param $string contains "dbname.tablename" + * @param $what what to extract (db|table) + * @return $string the extracted part */ -function PMA_replication_strout($string, $table = false) { +function PMA_extract_db_or_table($string, $what = 'db') { $list = explode(".", $string); - - return $list[(int)$table]; + if ('db' == $what) { + return $list[0]; + } else { + return $list[1]; + } } /** * @param String $action - possible values: START or STOP