Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix PHP Notice in db_mysqli.php
#1
Hi,

it would be nice, if you could fix the PHP Notice errors in db_mysqli.php. These are only very small changes. Maybe they can be included in the next bugfix version.

line 169:
if(!is_array($connections[$type]))
{
	break;
}
changed to
if(!isset($connections[$type]) || !is_array($connections[$type]))
{
	break;
}

line 198:
// Specified a custom port for this connection?
list($hostname, $port) = explode(":", $single_connection['hostname'], 2);
if($port)
{
	$this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $port);
}
changed to
// Specified a custom port for this connection?
$host = explode(":", $single_connection['hostname'], 2);
if(isset($host[1]))
{
	$this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $host[1]);
}

This one will only be raised, if for any reason $mybb isn't defined. This will never happen in the productive system, but using the database object itself in a plugin or development process, this may happen.
line 324:
if($mybb->debug_mode)
{
	$this->explain_query($string, $query_time);
}
changed to
if(!empty($mybb) && $mybb->debug_mode)
{
	$this->explain_query($string, $query_time);
}

#2
I'm pretty sure Rasmus Lerdorf fixed these. We'll be fixing a good deal of PHP notices in 1.6.9. Smile
No longer involved in the MyBB project.


Forum Jump:


Users browsing this thread: 1 Guest(s)