- Since upgrade to php 8.1 i am having a Undefined array key 0 in error log.
The line that shows the error is:
if(osc_subdomain_type() == 'category' && $cat[0]['s_slug'] != osc_subdomain_slug() || osc_subdomain_type() != 'category') { $category = $cat[0];
By putting the @ sign the error is suppressed but not solved.... How can i fix this? All help appreciated.
There is not much diff between using @ and different approach, however if you want to be 100% perfect, use:
$category = isset($cat[0]) ? $cat[0] : array(); }