db_mysqli.php (mybb_1822) | : | db_mysqli.php (mybb_1823) | ||
---|---|---|---|---|
skipping to change at line 193 | skipping to change at line 193 | |||
foreach(array('read', 'write') as $type) | foreach(array('read', 'write') as $type) | |||
{ | { | |||
if(!isset($connections[$type]) || !is_array($connections[ $type])) | if(!isset($connections[$type]) || !is_array($connections[ $type])) | |||
{ | { | |||
break; | break; | |||
} | } | |||
if(array_key_exists('hostname', $connections[$type])) | if(array_key_exists('hostname', $connections[$type])) | |||
{ | { | |||
$details = $connections[$type]; | $details = $connections[$type]; | |||
unset($connections); | unset($connections[$type]); | |||
$connections[$type][] = $details; | $connections[$type][] = $details; | |||
} | } | |||
// Shuffle the connections | // Shuffle the connections | |||
shuffle($connections[$type]); | shuffle($connections[$type]); | |||
// Loop-de-loop | // Loop-de-loop | |||
foreach($connections[$type] as $single_connection) | foreach($connections[$type] as $single_connection) | |||
{ | { | |||
$connect_function = "mysqli_connect"; | $connect_function = "mysqli_connect"; | |||
skipping to change at line 1038 | skipping to change at line 1038 | |||
} | } | |||
/** | /** | |||
* Escape a string used within a like command. | * Escape a string used within a like command. | |||
* | * | |||
* @param string $string The string to be escaped. | * @param string $string The string to be escaped. | |||
* @return string The escaped string. | * @return string The escaped string. | |||
*/ | */ | |||
function escape_string_like($string) | function escape_string_like($string) | |||
{ | { | |||
return $this->escape_string(str_replace(array('%', '_') , array(' \\%' , '\\_') , $string)); | return $this->escape_string(str_replace(array('\\', '%', '_') , a rray('\\\\', '\\%' , '\\_') , $string)); | |||
} | } | |||
/** | /** | |||
* Gets the current version of MySQL. | * Gets the current version of MySQL. | |||
* | * | |||
* @return string Version of MySQL. | * @return string Version of MySQL. | |||
*/ | */ | |||
function get_version() | function get_version() | |||
{ | { | |||
if($this->version) | if($this->version) | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |