Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter ElementHexa::decode() of non-hex chars (#687)
* Filter ElementHexa::decode() of non-hex chars Add a `preg_replace()` to `ElementHexa::decode()` so incoming strings are filtered of all non hexadecimal characters. Also remove the BOM (`feff`) if it exists. The function does a check for characters '00' at the beginning of the string to decide whether to 4-byte or 2-byte decode this string. It does not account for the 4-byte BOM and decodes such a string in a 2-byte fashion. It depends on further functions (in this case `Parser::parseHeaderElement()`) to repair the incorrectly decoded contents. Checking for and removing the BOM allows `ElementHexa::decode()` to return the correctly decoded contents the first time. * Update ElementHexa.php Instead of just deleting/ignoring it, separate out the BE BOM `feff` as an additional check for 4-byte hexadecimal content. * Cast preg_replace calls to strings
- Loading branch information