aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boot.php5
-rw-r--r--include/items.php4
-rw-r--r--include/poller.php4
3 files changed, 9 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index 13e1e1793..85e159883 100644
--- 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));
}}
diff --git a/include/items.php b/include/items.php
index beed024a1..1fdbc6fc2 100644
--- a/include/items.php
+++ b/include/items.php
@@ -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 = '';
diff --git a/include/poller.php b/include/poller.php
index 28e421f5f..fc45ff9c3 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -186,8 +186,8 @@
$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 = '';