pumpio: Avoiding some SQL warnings

This commit is contained in:
Michael Vogel 2013-10-19 00:27:22 +02:00
parent 2774d69b6a
commit 9ad282fe93
2 changed files with 10 additions and 6 deletions

View file

@ -484,7 +484,7 @@ function pumpio_send(&$a,&$b) {
logger('pumpio_send '.$username.': success '.$post_id); logger('pumpio_send '.$username.': success '.$post_id);
if($post_id AND $iscomment) { if($post_id AND $iscomment) {
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']); 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), dbesc($post_id),
intval($b['id']) intval($b['id'])
); );
@ -925,7 +925,7 @@ function pumpio_get_contact($uid, $contact) {
`name-date` = '%s', `name-date` = '%s',
`uri-date` = '%s', `uri-date` = '%s',
`avatar-date` = '%s' `avatar-date` = '%s'
WHERE `id` = %d LIMIT 1 WHERE `id` = %d
", ",
dbesc($photos[0]), dbesc($photos[0]),
dbesc($photos[1]), dbesc($photos[1]),
@ -952,8 +952,10 @@ function pumpio_get_contact($uid, $contact) {
`micro` = '%s', `micro` = '%s',
`name-date` = '%s', `name-date` = '%s',
`uri-date` = '%s', `uri-date` = '%s',
`avatar-date` = '%s' `avatar-date` = '%s',
WHERE `id` = %d LIMIT 1 `name` = '%s',
`nick` = '%s'
WHERE `id` = %d
", ",
dbesc($photos[0]), dbesc($photos[0]),
dbesc($photos[1]), dbesc($photos[1]),
@ -961,6 +963,8 @@ function pumpio_get_contact($uid, $contact) {
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc(datetime_convert()), dbesc(datetime_convert()),
dbesc($contact->displayName),
dbesc($contact->preferredUsername),
intval($r[0]['id']) intval($r[0]['id'])
); );
} }
@ -1347,7 +1351,7 @@ function pumpio_queue_hook(&$a,&$b) {
logger('pumpio_queue: send '.$username.': success '.$post_id); logger('pumpio_queue: send '.$username.': success '.$post_id);
if($post_id AND $iscomment) { if($post_id AND $iscomment) {
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']); 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), dbesc($post_id),
intval($z['item']) intval($z['item'])
); );

View file

@ -548,7 +548,7 @@ function statusnet_shortenmsg($b, $max_char) {
$msglink = $b["plink"]; $msglink = $b["plink"];
// If the message is short enough then don't modify it. (if the link exists in the original message) // 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"=>"")); return(array("msg"=>trim($origmsg), "image"=>""));
// If the message is short enough and contains a picture then post the picture as well // If the message is short enough and contains a picture then post the picture as well