I have a problem with hmlspecialchars giving an error in an OpenCart application. This is being logged in the error log but i have no idea which part of the application causes this since the code is being run on every request.
I tried catching exceptions on the function but i had nothing returned when the error occured. Will htmlspecialchars not be throwing any exceptions or is it possible that PHP is set to supress these? And in that case, could i change this at runtime?
try {
$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
} catch (Exception $e) {
$this->log->write($e->getMessage());
$this->log->write($e->getTraceAsString());
}