Update Core libs to avoid notice errors, add debug override switch

$DEBUG_ALL_OVERRIDE added to not override the set
$DEBUG_ALL/$PRINT_ALL/etc switches on one script.

Fix various notice bugs on very strict PHP setups.
This commit is contained in:
Clemens Schwaighofer
2015-11-06 11:43:01 +09:00
parent d67a4231c3
commit ae1ef182ef
4 changed files with 16 additions and 9 deletions

View File

@@ -725,7 +725,7 @@
$output = preg_replace_callback("/(href=\")?(\>)?\b($protRegex)([\w\.\-?&=+%#~,;\/]+)\b([\.\-?&=+%#~,;\/]*)(\|([^\||^#]+)(#([^\|]+))?\|)?/",
function ($matches) use ($self)
{
return $self->create_url($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]);
return @$self->create_url($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]);
},
$output
);
@@ -733,7 +733,7 @@
$output = preg_replace_callback("/(mailto:)?(\>)?\b([\w\.-]+)@([\w\.\-]+)\.([a-zA-Z]{2,4})\b(\|([^\||^#]+)(#([^\|]+))?\|)?/",
function ($matches) use ($self)
{
return $self->create_email($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]);
return @$self->create_email($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]);
},
$output
);
@@ -808,8 +808,11 @@
// get the host name without the port as given by the SELF var
public function get_host_name()
{
if ($_SERVER['HTTP_HOST'])
$port = '';
if ($_SERVER['HTTP_HOST'] && preg_match("/:/", $_SERVER['HTTP_HOST']))
list($host_name, $port) = explode(":", $_SERVER['HTTP_HOST']);
elseif ($_SERVER['HTTP_HOST'])
$host_name = $_SERVER['HTTP_HOST'];
else
$host_name = 'NA';
$this->host_port = $port ? $port : 80;
@@ -1077,6 +1080,7 @@
// xd xh xm xs xms to a timestamp.microtime format
public static function StringToTime($timestring)
{
$timestamp = '';
if (preg_match("/(d|h|m|s|ms)/", $timestring))
{
$timegroups = array (1 => 86400, 3 => 3600, 5 => 60, 7 => 1);

View File

@@ -652,7 +652,7 @@
{
// TODO: get primary key from table name
list($schema, $table) = $this->_db_return_table($this->query);
if (!$this->pk_name_table[$table])
if (!array_key_exists($table, $this->pk_name_table) || !$this->pk_name_table[$table])
{
$this->pk_name_table[$table] = $this->db_functions->_db_primary_key($table, $schema);
}
@@ -1321,7 +1321,7 @@
return false;
}
// check if this was already prepared
if (!is_array($this->prepare_cursor[$stm_name]))
if (!array_key_exists($stm_name, $this->prepare_cursor) || !is_array($this->prepare_cursor[$stm_name]))
{
// if this is an insert query, check if we can add a return
if ($this->_check_query_for_insert($query, true))