]> git.mxchange.org Git - friendica.git/blobdiff - mod/wall_attach.php
Use short form array syntax everywhere
[friendica.git] / mod / wall_attach.php
index cfb1558a24caf17bde98d74cdd34c410a3cfbd0d..472a8073247e9a96d7150d50da9e6150a43367a7 100644 (file)
@@ -20,7 +20,7 @@ function wall_attach_post(App $a) {
                );
                if (! DBM::is_result($r)) {
                        if ($r_json) {
-                               echo json_encode(array('error'=>t('Invalid request.')));
+                               echo json_encode(['error'=>t('Invalid request.')]);
                                killme();
                        }
                        return;
@@ -28,7 +28,7 @@ function wall_attach_post(App $a) {
 
        } else {
                if ($r_json) {
-                       echo json_encode(array('error'=>t('Invalid request.')));
+                       echo json_encode(['error'=>t('Invalid request.')]);
                        killme();
                }
                return;
@@ -70,7 +70,7 @@ function wall_attach_post(App $a) {
        }
        if(! $can_post) {
                if ($r_json) {
-                       echo json_encode(array('error'=>t('Permission denied.')));
+                       echo json_encode(['error'=>t('Permission denied.')]);
                        killme();
                }
                notice( t('Permission denied.') . EOL );
@@ -79,7 +79,7 @@ function wall_attach_post(App $a) {
 
        if(! x($_FILES,'userfile')) {
                if ($r_json) {
-                       echo json_encode(array('error'=>t('Invalid request.')));
+                       echo json_encode(['error'=>t('Invalid request.')]);
                }
                killme();
        }
@@ -99,7 +99,7 @@ function wall_attach_post(App $a) {
        if($filesize <=0) {
                $msg = t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(t('Or - did you try to upload an empty file?'));
                if ($r_json) {
-                       echo json_encode(array('error'=>$msg));
+                       echo json_encode(['error'=>$msg]);
                } else {
                        notice( $msg. EOL );
                }
@@ -110,7 +110,7 @@ function wall_attach_post(App $a) {
        if(($maxfilesize) && ($filesize > $maxfilesize)) {
                $msg = sprintf(t('File exceeds size limit of %s'), formatBytes($maxfilesize));
                if ($r_json) {
-                       echo json_encode(array('error'=>$msg));
+                       echo json_encode(['error'=>$msg]);
                } else {
                        echo  $msg. EOL ;
                }
@@ -123,9 +123,9 @@ function wall_attach_post(App $a) {
        $hash = get_guid(64);
        $created = datetime_convert();
 
-       $fields = array('uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
+       $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' => '');
+               'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => ''];
 
        $r = dba::insert('attach', $fields);
 
@@ -134,7 +134,7 @@ function wall_attach_post(App $a) {
        if(! $r) {
                $msg =  t('File upload failed.');
                if ($r_json) {
-                       echo json_encode(array('error'=>$msg));
+                       echo json_encode(['error'=>$msg]);
                } else {
                        echo  $msg. EOL ;
                }
@@ -150,7 +150,7 @@ function wall_attach_post(App $a) {
        if (! DBM::is_result($r)) {
                $msg = t('File upload failed.');
                if ($r_json) {
-                       echo json_encode(array('error'=>$msg));
+                       echo json_encode(['error'=>$msg]);
                } else {
                        echo  $msg. EOL ;
                }
@@ -158,7 +158,7 @@ function wall_attach_post(App $a) {
        }
 
        if ($r_json) {
-               echo json_encode(array('ok'=>true));
+               echo json_encode(['ok'=>true]);
                killme();
        }