I will test your solution in my environment.

And this is what I came up with. It seems to be working for all attributes.
before
PHP Code:
          }
          
$having .= ' FIND_IN_SET("' $key $value '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
          
$filter_attr true;
          
$prvHaving $key;
        }
      }
    }
  }
  if(
$filter != ''$filter .= ')'
After
PHP Code:
          }
$var1 addslashes($value);
          
$having .= ' FIND_IN_SET("' $key $var1 '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
          
$filter_attr true;
          
$prvHaving $key;
        }
      }
    }
  }
  if(
$filter != ''$filter .= ')'
What do you think?

I don't know whether it will have issues later on!