]> git.mxchange.org Git - friendica.git/commitdiff
And some more inserts
authorMichael <heluecht@pirati.ca>
Wed, 9 Aug 2017 22:23:46 +0000 (22:23 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 9 Aug 2017 22:23:46 +0000 (22:23 +0000)
include/diaspora.php
include/oembed.php

index 77c459e649830ed16e89cad5abd7340ab2ae847c..60c613178b90fc3e4ba01a71bbebc39275b843c4 100644 (file)
@@ -1475,10 +1475,7 @@ class Diaspora {
 
                        // 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.
-                       q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')",
-                               intval($message_id),
-                               dbesc(json_encode($data))
-                       );
+                       dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
 
                        // notify others
                        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.
                        // We now store the raw data so that we are more flexible.
-                       q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')",
-                               intval($message_id),
-                               dbesc(json_encode($data))
-                       );
+                       dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
 
                        // notify others
                        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.
                 * This will break Diaspora compatibility with Friendica versions prior to 3.5.
                 */
-               q("INSERT INTO `sign` (`iid`,`signed_text`) VALUES (%d,'%s')",
-                       intval($post_id),
-                       dbesc(json_encode($message))
-               );
+               dba::insert('sign', array('iid' => $post_id, 'signed_text' => json_encode($message)));
 
                logger('Stored diaspora like signature');
                return true;
@@ -3763,10 +3754,7 @@ class Diaspora {
                 * Now store the signature more flexible to dynamically support new fields.
                 * This will break Diaspora compatibility with Friendica versions prior to 3.5.
                 */
-               q("INSERT INTO `sign` (`iid`, `signed_text`) VALUES (%d, '%s')",
-                       intval($message_id),
-                       dbesc(json_encode($message))
-               );
+               dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($message)));
 
                logger('Stored diaspora comment signature');
                return true;
index 0f3296b254c9a7db2e2efa29f48b8695fd6d7c28..de597bbb37ab91bfe9604b01683b0c9dbb80d3ba 100755 (executable)
@@ -82,11 +82,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                } else {        //save in cache
                        $j = json_decode($txt);
                        if ($j->type != "error") {
-                               q("INSERT INTO `oembed` (`url`, `content`, `created`) VALUES ('%s', '%s', '%s')
-                                       ON DUPLICATE KEY UPDATE `content` = '%s', `created` = '%s'",
-                                       dbesc(normalise_link($embedurl)),
-                                       dbesc($txt), dbesc(datetime_convert()),
-                                       dbesc($txt), dbesc(datetime_convert()));
+                               dba::insert('oembed', array('url' => normalise_link($embedurl),
+                                                       'content' => $txt, 'created' => datetime_convert()));
                        }
 
                        Cache::set($a->videowidth.$embedurl, $txt, CACHE_DAY);