From d1833cabf67b35a10a676d69a1e45fe7aadc31bc Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 20 Oct 2011 19:11:34 -0700 Subject: [PATCH] fix hex2bin for empty input --- include/text.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/text.php b/include/text.php index 299410a63d..ca8dc5ac3b 100644 --- a/include/text.php +++ b/include/text.php @@ -195,6 +195,9 @@ function unxmlify($s) { if(! function_exists('hex2bin')) { function hex2bin($s) { + if(! (is_string($s) && strlen($s))) + return ''; + if(! ctype_xdigit($s)) { logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true)); return($s);