mirror of
https://github.com/friendica/friendica
synced 2024-11-10 06:22:53 +00:00
fix hex2bin for empty input
This commit is contained in:
parent
01164c8c2f
commit
d1833cabf6
1 changed files with 3 additions and 0 deletions
|
@ -195,6 +195,9 @@ function unxmlify($s) {
|
||||||
|
|
||||||
if(! function_exists('hex2bin')) {
|
if(! function_exists('hex2bin')) {
|
||||||
function hex2bin($s) {
|
function hex2bin($s) {
|
||||||
|
if(! (is_string($s) && strlen($s)))
|
||||||
|
return '';
|
||||||
|
|
||||||
if(! ctype_xdigit($s)) {
|
if(! ctype_xdigit($s)) {
|
||||||
logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
|
logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
|
||||||
return($s);
|
return($s);
|
||||||
|
|
Loading…
Reference in a new issue