X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fwall_attach.php;h=cf5d11f8bf26d1429a6e213beb2318e95b063ece;hb=d3144e283749877d49910d66cc6cc81f15ec1e04;hp=57d7b2e95279b22d53b3be4d8f3508e9f4d69145;hpb=6b44fbbda03af125035c185c964f10ce78f97610;p=friendica.git diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 57d7b2e952..cf5d11f8bf 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -2,14 +2,16 @@ /** * @file mod/wall_attach.php */ + use Friendica\App; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Core\System; +use Friendica\Database\DBA; use Friendica\Database\DBM; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Mimetype; -require_once 'include/datetime.php'; - function wall_attach_post(App $a) { $r_json = (x($_GET,'response') && $_GET['response']=='json'); @@ -121,14 +123,14 @@ function wall_attach_post(App $a) { $filedata = @file_get_contents($src); $mimetype = Mimetype::getContentType($filename); - $hash = get_guid(64); - $created = datetime_convert(); + $hash = System::createGUID(64); + $created = DateTimeFormat::utcNow(); $fields = ['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); + $r = DBA::insert('attach', $fields); @unlink($src);