Skip to content

Commit

Permalink
Fix for empty var, #52
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge authored Jun 10, 2021
1 parent 490998c commit c191efe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inc/class-all_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ function record_hook_usage( $hook ) {
)
);
$str_replace = $doc_root . preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' );
$file_name = addslashes( str_replace( $str_replace, '', $callstack[3]['file'] ) );
$line_num = $callstack[3]['line'];

$file_name = __( 'Unavailable file', parent :: get_plugin_data() );
if ( ! isset( $callstack[3]['file'] ) )
$file_name = addslashes( str_replace( $str_replace, '', $callstack[3]['file'] ) );
$file_num = __( 'Unavailable line', parent :: get_plugin_data() );
if ( ! isset( $callstack[3]['line'] ) )
$line_num = $callstack[3]['line'];
$called_by = $callstack[4]['function'] . '()';
if ( ! isset( $callstack[4] ) )
$called_by = __( 'Undefinded', parent :: get_plugin_data() );
else
$called_by = $callstack[4]['function'] . '()';

$wpdb -> query( "INSERT " . parent::$table . "
(first_call,called_by,hook_name,hook_type,arg_count,file_name,line_num)
Expand Down

0 comments on commit c191efe

Please sign in to comment.