]> git.mxchange.org Git - friendica.git/blobdiff - mod/wall_attach.php
Expose IHTTPClient::request()
[friendica.git] / mod / wall_attach.php
index f04698c5643641c110909406038cedad429098a4..9d5641874ba68453b2834e6a386093da795de89f 100644 (file)
@@ -1,12 +1,28 @@
 <?php
 /**
- * @file mod/wall_attach.php
+ * @copyright Copyright (C) 2010-2021, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
-use Friendica\Core\Config;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Attach;
 use Friendica\Model\User;
 use Friendica\Util\Strings;
@@ -15,8 +31,8 @@ function wall_attach_post(App $a) {
 
        $r_json = (!empty($_GET['response']) && $_GET['response']=='json');
 
-       if ($a->argc > 1) {
-               $nick = $a->argv[1];
+       if (DI::args()->getArgc() > 1) {
+               $nick = DI::args()->getArgv()[1];
                $r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid`  WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
                        DBA::escape($nick)
                );
@@ -77,7 +93,7 @@ function wall_attach_post(App $a) {
        $filename = basename($_FILES['userfile']['name']);
        $filesize = intval($_FILES['userfile']['size']);
 
-       $maxfilesize = Config::get('system','maxfilesize');
+       $maxfilesize = DI::config()->get('system','maxfilesize');
 
        /* Found html code written in text field of form,
         * when trying to upload a file with filesize
@@ -90,7 +106,7 @@ function wall_attach_post(App $a) {
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
-                       notice($msg . EOL);
+                       notice($msg);
                }
                @unlink($src);
                exit();