admin管理员组文章数量:1125452
I tried to read similar questions, but not easy for me to understand.
I have hundreds, maybe thousands, of those warnings my error_log, generated multiple times 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 16
Now, 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
/**
* 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;
}
Need to add that at line 16 there is no attempt to access array using key “HTTP_REFERER”.
Hope someone can help me with this. Thanks in advance. Regards. mario.
本文标签: errorsPHP Warning Undefined array key “HTTPREFERER”
版权声明:本文标题:errors - PHP Warning: Undefined array key “HTTP_REFERER” 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736667839a1946757.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论