]> git.mxchange.org Git - friendica.git/commitdiff
Last blob is now filled with the new functions
authorMichael <heluecht@pirati.ca>
Fri, 15 Sep 2017 21:17:58 +0000 (21:17 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 15 Sep 2017 21:17:58 +0000 (21:17 +0000)
mod/wall_attach.php

index 8bf1fdbf19d6293b0bada256d2bc4362fc4debae..9f455a19f345ff1fddfaf50be7f24f8c2930fded 100644 (file)
@@ -138,21 +138,12 @@ function wall_attach_post(App $a) {
        $mimetype = z_mime_content_type($filename);
        $hash = get_guid(64);
        $created = datetime_convert();
-       $r = q("INSERT INTO `attach` ( `uid`, `hash`, `filename`, `filetype`, `filesize`, `data`, `created`, `edited`, `allow_cid`, `allow_gid`,`deny_cid`, `deny_gid` )
-               VALUES ( %d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
-               intval($page_owner_uid),
-               dbesc($hash),
-               dbesc($filename),
-               dbesc($mimetype),
-               intval($filesize),
-               dbesc($filedata),
-               dbesc($created),
-               dbesc($created),
-               dbesc('<' . $page_owner_cid . '>'),
-               dbesc(''),
-               dbesc(''),
-               dbesc('')
-       );
+
+       $fields = array('uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
+               'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
+               'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => '');
+
+       $r = dba::insert('attach', $fields);
 
        @unlink($src);