From: Michael Vogel Date: Fri, 18 Oct 2013 22:27:22 +0000 (+0200) Subject: pumpio: Avoiding some SQL warnings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9ad282fe934b4a3a5075b97a7affe28fa789116a;p=friendica-addons.git pumpio: Avoiding some SQL warnings --- diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 4bab7be5..24532b41 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -484,7 +484,7 @@ function pumpio_send(&$a,&$b) { logger('pumpio_send '.$username.': success '.$post_id); if($post_id AND $iscomment) { logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']); - q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1", + q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d", dbesc($post_id), intval($b['id']) ); @@ -925,7 +925,7 @@ function pumpio_get_contact($uid, $contact) { `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s' - WHERE `id` = %d LIMIT 1 + WHERE `id` = %d ", dbesc($photos[0]), dbesc($photos[1]), @@ -952,8 +952,10 @@ function pumpio_get_contact($uid, $contact) { `micro` = '%s', `name-date` = '%s', `uri-date` = '%s', - `avatar-date` = '%s' - WHERE `id` = %d LIMIT 1 + `avatar-date` = '%s', + `name` = '%s', + `nick` = '%s' + WHERE `id` = %d ", dbesc($photos[0]), dbesc($photos[1]), @@ -961,6 +963,8 @@ function pumpio_get_contact($uid, $contact) { dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc(datetime_convert()), + dbesc($contact->displayName), + dbesc($contact->preferredUsername), intval($r[0]['id']) ); } @@ -1347,7 +1351,7 @@ function pumpio_queue_hook(&$a,&$b) { logger('pumpio_queue: send '.$username.': success '.$post_id); if($post_id AND $iscomment) { logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']); - q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1", + q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d", dbesc($post_id), intval($z['item']) ); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 2c979540..66aa3bd5 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -548,7 +548,7 @@ function statusnet_shortenmsg($b, $max_char) { $msglink = $b["plink"]; // If the message is short enough then don't modify it. (if the link exists in the original message) - if ((strlen(trim($origmsg)) <= $max_char) AND (strpos($origmsg, $msglink) OR ($msglink == ""))) + if ((strlen(trim($origmsg)) <= $max_char) AND (($msglink == "") OR strpos($origmsg, $msglink))) return(array("msg"=>trim($origmsg), "image"=>"")); // If the message is short enough and contains a picture then post the picture as well