]> git.mxchange.org Git - friendica.git/commitdiff
fix hex2bin for empty input
authorFriendika <info@friendika.com>
Fri, 21 Oct 2011 02:11:34 +0000 (19:11 -0700)
committerFriendika <info@friendika.com>
Fri, 21 Oct 2011 02:11:34 +0000 (19:11 -0700)
include/text.php

index 299410a63d99b6f1860b0bca8ca482f286f5ea1b..ca8dc5ac3b474569b793a97e555cec979ae0378c 100644 (file)
@@ -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);