]> git.mxchange.org Git - friendica.git/commitdiff
tracking errant bin2hex call
authorFriendika <info@friendika.com>
Tue, 18 Jan 2011 05:08:16 +0000 (21:08 -0800)
committerFriendika <info@friendika.com>
Tue, 18 Jan 2011 05:08:16 +0000 (21:08 -0800)
boot.php
include/items.php
include/poller.php

index 13e1e17936b34ad0fe583480eaf836f3237da001..85e1598831c015346aa3612a48682d20e6b43879 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -945,6 +945,11 @@ function unxmlify($s) {
 
 if(! function_exists('hex2bin')) {
 function hex2bin($s) {
+       if(! ctype_xdigit($s)) {
+               logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
+               return($s);
+       }
+
        return(pack("H*",$s));
 }}
 
index beed024a1ceaed23e8e90537c6a073b4c8d4c288..1fdbc6fc2090e4731a4b7e7f2be0dbad1b203a5a 100644 (file)
@@ -788,8 +788,8 @@ function dfrn_deliver($owner,$contact,$atom) {
                return (($res->status) ? $res->status : 3);
 
        $postvars     = array();
-       $sent_dfrn_id = hex2bin($res->dfrn_id);
-       $challenge    = hex2bin($res->challenge);
+       $sent_dfrn_id = hex2bin((string) $res->dfrn_id);
+       $challenge    = hex2bin((string) $res->challenge);
        $rino_allowed = ((intval($res->rino) === 1) ? 1 : 0);
 
        $final_dfrn_id = '';
index 28e421f5fe805443e4fe191f0cea1a2d20408605..fc45ff9c3e16865086a4ff8c4f67318e48cf1fe2 100644 (file)
 
                        $postvars = array();
 
-                       $sent_dfrn_id = hex2bin($res->dfrn_id);
-                       $challenge    = hex2bin($res->challenge);
+                       $sent_dfrn_id = hex2bin((string) $res->dfrn_id);
+                       $challenge    = hex2bin((string) $res->challenge);
 
                        $final_dfrn_id = '';