"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/inc/db_pgsql.php" between
mybb_1822.zip and mybb_1823.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

db_pgsql.php  (mybb_1822):db_pgsql.php  (mybb_1823)
skipping to change at line 197 skipping to change at line 197
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 = "pg_connect"; $connect_function = "pg_connect";
skipping to change at line 482 skipping to change at line 482
return pg_num_rows($query); return pg_num_rows($query);
} }
/** /**
* Return the last id number of inserted data. * Return the last id number of inserted data.
* *
* @return int The id number. * @return int The id number.
*/ */
function insert_id() function insert_id()
{ {
$this->last_query = str_replace(array("\r", "\t"), '', $this->las preg_match('#INSERT\s+INTO\s+([a-zA-Z0-9_\-]+)#i', $this->last_qu
t_query); ery, $matches);
$this->last_query = str_replace("\n", ' ', $this->last_query);
preg_match('#INSERT INTO ([a-zA-Z0-9_\-]+)#i', $this->last_query,
$matches);
$table = $matches[1]; $table = $matches[1];
$query = $this->query("SELECT column_name FROM information_schema .constraint_column_usage WHERE table_name = '{$table}' and constraint_name = '{$ table}_pkey' LIMIT 1"); $query = $this->query("SELECT column_name FROM information_schema .constraint_column_usage WHERE table_name = '{$table}' and constraint_name = '{$ table}_pkey' LIMIT 1");
$field = $this->fetch_field($query, 'column_name'); $field = $this->fetch_field($query, 'column_name');
// Do we not have a primary field? // Do we not have a primary field?
if(!$field) if(!$field)
{ {
return 0; return 0;
skipping to change at line 967 skipping to change at line 965
} }
/** /**
* 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 PgSQL. * Gets the current version of PgSQL.
* *
* @return string Version of PgSQL. * @return string Version of PgSQL.
*/ */
function get_version() function get_version()
{ {
if($this->version) if($this->version)
 End of changes. 3 change blocks. 
7 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)