Fixed the escaping on attribute values for data attributes by replacing the htmlentities() method with phptal_escape().