• Dear Support

    I am getting the following error on Google description for my website

    Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /home/public_html/wp/wp-content/plugins/wc-fields-factory/includes/wcff-locale.php on line 210 .

    The error does not seem to be printed in the DOM, since I used Google Dev tools and I didnt see the text anywhere.

    Am not sure why Google is picking that Notice.

    As you can appreciate this is not something that search engines should be able to see or index.

    Could you please help me resolve this?

    Kind regards
    Christos

Viewing 1 replies (of 1 total)
  • I have this error too, only that something inside wordpress changes my display_errors setting, so I see this on my site sometimes because it’s cached.
    This seems to happen when a client doesn’t set the HTTP_ACCEPT_LANGUAGE header. Probably search engines. The fix is to check that the variable exists before using it. Here’s a patch:

    --- a/wp-content/plugins/wc-fields-factory/includes/wcff-locale.php	2018-04-26 11:22:44.217060270 +0200
    +++ b/wp-content/plugins/wc-fields-factory/includes/wcff-locale.php	2018-04-26 11:26:04.829774539 +0200
    @@ -206,10 +206,10 @@
         public function detrmine_current_locale() {
         	$locale = "en";
         	/* Locale from Browser */
    -    	if(function_exists("locale_accept_from_http")) {
    -    		$locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
    -    	} else {
    -    		if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    +	if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    +	    	if(function_exists("locale_accept_from_http")) {
    +	    		$locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
    +    		} else {
         			$locale = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
         		}
         	}
Viewing 1 replies (of 1 total)

The topic ‘Undefined index: HTTP_ACCEPT_LANGUAGE’ is closed to new replies.