Hi all,
I've spent far to many hours pulling my hair out, and need to admit defeat and ask for help. It probably an easy fix for someone who knows what they're doing, there's a lot of similar issues posted before me, but implementing fixes suggested before hasn't helped.
The filter works perfectly in some categories (https://ainleyorganics.co.uk/breakfast-products-c-848/), but breaks the page in others (https://ainleyorganics.co.uk/breads-c-798/).
My functions_general.php file is as follows:
My log file is as follows:Code:function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) { if (!is_array($exclude_array)) $exclude_array = array(); $exclude_array = array_merge($exclude_array, array(zen_session_name(), 'main_page', 'error', 'x', 'y')); $get_url = ''; if (is_array($_GET) && (sizeof($_GET) > 0)) { reset($_GET); while (list($key, $value) = each($_GET)) { // bof dynamic filter 1 of 3 if ( (!in_array($key, $exclude_array)) && (strlen($value) > 0 || is_array($value) && array_filter($value) ) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && ($key != 'x') && ($key != 'y') ) { // eof dynamic filter 1 of 3 if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { // die ('here'); $get_url .= $key . '/' . rawurlencode(stripslashes($value)) . '/'; } else { // bof dynamic filter 2 of 3 if (is_array($value)) { foreach($value as $arr){ $get_url .= zen_sanitize_string($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&'; } } else { // eof dynamic filter 2 of 3 $get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&'; // bof dynamic filter 3 of 3 } // eof dynamic filter 3 of 3 } } } } while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url); while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url); return $get_url; }
I'd really appreciate some help on this. Thanks in advance.Code:PHP Warning: strlen() expects parameter 1 to be string, array given in /home/....../public_html/includes/functions/functions_general.php on line 152


Reply With Quote
