benjancewicz
Member
Posted 4 years ago #
I'm getting the following error on this site whenever I try to post a comment.
Fatal error: Cannot redeclare add_magic_quotes() (previously declared in /home/content/r/y/a/ryanpaugh/html/wp-comments-post.php:4) in /home/content/r/y/a/ryanpaugh/html/wp-includes/functions.php on line 1257
Any idea what could possibly be causing it? I deactivated all my plugins, and it didn't do anything.
benjancewicz
Member
Posted 4 years ago #
Line 4 of wp-comments-post.php looks like this:
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} el se {
$array[$k] = addslashes($v);
}
}
return $array;
}
Line 1257 of functions.php looks like this:
function add_magic_quotes( $array ) {
global $wpdb;
foreach ( (array) $array as $k => $v ) {
if ( is_array( $v ) ) {
$array[$k] = add_magic_quotes( $v );
} else {
$array[$k] = $wpdb->escape( $v );
}
}
return $array;
}
benjancewicz
Member
Posted 4 years ago #
Reinstalled. It fixed it.