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);
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'])
);

View File

@ -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