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:
@@ -1,11 +1,11 @@
|
||||
<?
|
||||
$DEBGU_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL)
|
||||
error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
|
||||
require('libs/Error.Handling.inc');
|
||||
|
||||
define('USE_DATABASE', true);
|
||||
// sample config
|
||||
|
||||
@@ -91,12 +91,15 @@
|
||||
//------------------------------ page rights ned
|
||||
|
||||
// automatic hide for DEBUG messages on live server
|
||||
if (TARGET == 'live' || TARGET == 'remote')
|
||||
// can be overridden when setting DEBUG_ALL_OVERRIDE on top of the script (for emergency debugging of one page only)
|
||||
if ((TARGET == 'live' || TARGET == 'remote') && !$DEBUG_ALL_OVERRIDE)
|
||||
{
|
||||
$login->debug_output_all = 0;
|
||||
$cms->debug_output_all = 1;
|
||||
$login->echo_output_all = 0;
|
||||
$login->print_output_all = 0;
|
||||
$cms->debug_output_all = 0;
|
||||
$cms->echo_output_all = 0;
|
||||
$cms->print_output_all = 1;
|
||||
$cms->print_output_all = 0;
|
||||
}
|
||||
$cms->DATA['JS_DEBUG'] = DEBUG;
|
||||
?>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user