PHP Warning: Undefined array key “HTTP_REFERER”
-
I have thousands of those warnings my error_log, generated multiple each day.
That’s the error.
[14-Jan-2024 14:32:50 UTC] PHP Warning: Undefined array key "HTTP_REFERER" in /home/gialloec/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code on line 16Now, searching on line 582 of file snippet-ops.php, I find this statement
$result = eval( $code );just to give more context, this is the function. Can somebody help me?
Regards.
Mario
/** * Execute a snippet. * Execute operation. * * Code must NOT be escaped, as it will be executed directly. * * @param string $code Snippet code to execute. * @param integer $id Snippet ID. * @param boolean $force Force snippet execution, even if save mode is active. * * @return ParseError|mixed Code error if encountered during execution, or result of snippet execution otherwise. * * @since 2.0.0 */ function execute_snippet( string $code, int $id = 0, bool $force = false ) { if ( empty( $code ) || ! $force && defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) { return false; } ob_start(); try { $result = eval( $code ); } catch ( ParseError $parse_error ) { $result = $parse_error; } ob_end_clean(); do_action( 'code_snippets/after_execute_snippet', $code, $id, $result ); return $result; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘PHP Warning: Undefined array key “HTTP_REFERER”’ is closed to new replies.