Permalink
Browse files

LOG_DATABASE causes 'Array to string conversion' system notice

This is due to using $p_msg instead of $s_msg in log_event() at line 93.

Fixes #15685
  • Loading branch information...
1 parent b55fc0d commit e312d228504386ef549da6f6e06cfeb862999809 @dregad dregad committed Mar 27, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 core/database_api.php
  2. +1 −1 core/logging_api.php
View
@@ -367,8 +367,9 @@ function db_query_bound( $p_query, $arr_parms = null, $p_limit = -1, $p_offset =
$i++;
}
}
- log_event( LOG_DATABASE, array( $p_query, $t_elapsed), debug_backtrace() );
- array_push( $g_queries_array, array( $p_query, $t_elapsed ) );
+ $t_log_msg = array( $p_query, $t_elapsed );
+ log_event( LOG_DATABASE, $t_log_msg, debug_backtrace() );
+ array_push( $g_queries_array, $t_log_msg );
} else {
array_push( $g_queries_array, array( '', $t_elapsed ) );
}
View
@@ -90,7 +90,7 @@ function log_event( $p_level, $p_msg, $p_backtrace = null ) {
$t_now = date( config_get_global( 'complete_date_format' ) );
$t_level = $g_log_levels[$p_level];
- $t_plugin_event = '[' . $t_level . '] ' . $p_msg;
+ $t_plugin_event = '[' . $t_level . '] ' . $s_msg;
if( function_exists( 'event_signal' ) )
event_signal( 'EVENT_LOG', array( $t_plugin_event ) );

0 comments on commit e312d22

Please sign in to comment.