1
1
Fork 0

And some more inserts

This commit is contained in:
Michael 2017-08-09 22:23:46 +00:00
parent 6180d62ebc
commit c6b04aa922
2 changed files with 6 additions and 21 deletions

View file

@ -1475,10 +1475,7 @@ class Diaspora {
// Formerly we stored the signed text, the signature and the author in different fields. // Formerly we stored the signed text, the signature and the author in different fields.
// We now store the raw data so that we are more flexible. // We now store the raw data so that we are more flexible.
q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')", dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
intval($message_id),
dbesc(json_encode($data))
);
// notify others // notify others
proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id); proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id);
@ -1783,10 +1780,7 @@ class Diaspora {
// Formerly we stored the signed text, the signature and the author in different fields. // Formerly we stored the signed text, the signature and the author in different fields.
// We now store the raw data so that we are more flexible. // We now store the raw data so that we are more flexible.
q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')", dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
intval($message_id),
dbesc(json_encode($data))
);
// notify others // notify others
proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id); proc_run(PRIORITY_HIGH, "include/notifier.php", "comment-import", $message_id);
@ -3728,10 +3722,7 @@ class Diaspora {
* Now store the signature more flexible to dynamically support new fields. * Now store the signature more flexible to dynamically support new fields.
* This will break Diaspora compatibility with Friendica versions prior to 3.5. * This will break Diaspora compatibility with Friendica versions prior to 3.5.
*/ */
q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')", dba::insert('sign', array('iid' => $post_id, 'signed_text' => json_encode($message)));
intval($post_id),
dbesc(json_encode($message))
);
logger('Stored diaspora like signature'); logger('Stored diaspora like signature');
return true; return true;
@ -3763,10 +3754,7 @@ class Diaspora {
* Now store the signature more flexible to dynamically support new fields. * Now store the signature more flexible to dynamically support new fields.
* This will break Diaspora compatibility with Friendica versions prior to 3.5. * This will break Diaspora compatibility with Friendica versions prior to 3.5.
*/ */
q("INSERT INTO `sign` (`iid`, `signed_text`) VALUES (%d, '%s')", dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($message)));
intval($message_id),
dbesc(json_encode($message))
);
logger('Stored diaspora comment signature'); logger('Stored diaspora comment signature');
return true; return true;

View file

@ -82,11 +82,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
} else { //save in cache } else { //save in cache
$j = json_decode($txt); $j = json_decode($txt);
if ($j->type != "error") { if ($j->type != "error") {
q("INSERT INTO `oembed` (`url`, `content`, `created`) VALUES ('%s', '%s', '%s') dba::insert('oembed', array('url' => normalise_link($embedurl),
ON DUPLICATE KEY UPDATE `content` = '%s', `created` = '%s'", 'content' => $txt, 'created' => datetime_convert()));
dbesc(normalise_link($embedurl)),
dbesc($txt), dbesc(datetime_convert()),
dbesc($txt), dbesc(datetime_convert()));
} }
Cache::set($a->videowidth.$embedurl, $txt, CACHE_DAY); Cache::set($a->videowidth.$embedurl, $txt, CACHE_DAY);