Hi, after doing some research i found a solution to fix the annoying problem with PHP 7.0 and above:
Warning: Illegal string offset [xxx] on line xxx & Cannot Assign Empty String To String Offset.
Answer: Problem is that our variable $array is not set or initialized as an array() in case of $something part being undefined in the first place!
This was apparently fine in PHP 7.0 and below, but not anymore. Now, PHP will NOT assume or automatically fix our problem any longer, and we need to explicitly set it as array() a priory.
Here is a simple "bad" code:
$array = $something; // $something can be anything, another function call, for example, that might return empty/null, array or string
if(!isset($array['id']) ) {
$array['id'] = '';
}
Fixed Code:
$array = (array) $something; // simply cast $variable as array()
if(!isset($array['id']) ) {
$array['id'] = '';
}
Some fixes:
On Bender theme V3.1.4, V3.2.0 sidebar-search.php Line 21:
Change from:
$category = __get("category");
To:
$category = (array) __get("category");
On Zara Theme v1.2.x-v1.28, item-post.php Line 274:
Change from:
$user_info = '';
To:
$user_info = (array) '';