// CRM-19093
// should match the civicrm table name such as: civicrm_event
// but must not match the table name if it's a substring of another table: civicrm_events_in_cart
- $query = preg_replace("/([^'\"])({$table})($|[^a-z_'\"])/", "\\1\\2{$dbLocale}\\3", $query);
+ $query = preg_replace("/([^'\"])({$table})(\z|[^a-z_'\"])/", "\\1\\2{$dbLocale}\\3", $query);
}
// uncomment the below to rewrite the civicrm_value_* queries
// $query = preg_replace("/(civicrm_value_[a-z0-9_]+_\d+)([^_])/", "\\1{$dbLocale}\\2", $query);
$this->assertEquals("DELETE FROM {$expectedRewrite}", $new_query8);
$query9 = 'INSERT INTO ' . "{$table}" . ' (foo, bar) VALUES (123, "' . "Just a {$table} string" . '")';
$new_query9 = CRM_Core_I18n_Schema::rewriteQuery($query9);
- $this->assertEquals('INSERT INTO ' . "{$expectedRewrite}" . ' (foo, bar) VALUES (123, "' . "Just a {$table} string)", $new_query9);
+ $this->assertEquals('INSERT INTO ' . "{$expectedRewrite}" . ' (foo, bar) VALUES (123, "' . "Just a {$table} string" . '")', $new_query9);
}
}