Merge pull request #5719 from annando/notices-yeah
[friendica.git/.git] / mod / attach.php
index e76fe84..99f0fc4 100644 (file)
@@ -6,7 +6,6 @@
 use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Database\DBA;
-use Friendica\Database\DBM;
 
 require_once 'include/dba.php';
 require_once 'include/security.php';
@@ -23,7 +22,7 @@ function attach_init(App $a)
        // Check for existence, which will also provide us the owner uid
 
        $r = DBA::selectFirst('attach', [], ['id' => $item_id]);
-       if (!DBM::is_result($r)) {
+       if (!DBA::isResult($r)) {
                notice(L10n::t('Item was not found.'). EOL);
                return;
        }
@@ -33,10 +32,10 @@ function attach_init(App $a)
        // Now we'll see if we can access the attachment
 
        $r = q("SELECT * FROM `attach` WHERE `id` = '%d' $sql_extra LIMIT 1",
-               dbesc($item_id)
+               DBA::escape($item_id)
        );
 
-       if (!DBM::is_result($r)) {
+       if (!DBA::isResult($r)) {
                notice(L10n::t('Permission denied.') . EOL);
                return;
        }