From 518f28a7bf0b2e21feb82f7ba2477406e818313e Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 4 Jan 2019 07:45:08 +0100 Subject: [PATCH] Small fixes - Avoid an intermediate variable - Use `rawContent()` in `Attach` module - Small typo --- mod/videos.php | 3 +-- src/Core/Console/Storage.php | 2 +- src/Module/Attach.php | 8 +++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mod/videos.php b/mod/videos.php index a117e0f1a8..408e2acaa6 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -114,8 +114,7 @@ function videos_post(App $a) $video_id = $_POST['id']; - $r = Attach::exists(['id' => $video_id, 'uid' => local_user()]); - if ($r === true) { + if (Attach::exists(['id' => $video_id, 'uid' => local_user()])) { // delete the attachment Attach::delete(['id' => $video_id, 'uid' => local_user()]); diff --git a/src/Core/Console/Storage.php b/src/Core/Console/Storage.php index 601019fa8b..f9674c4d19 100644 --- a/src/Core/Console/Storage.php +++ b/src/Core/Console/Storage.php @@ -22,7 +22,7 @@ Synopsis Show this help bin/console storage list - List avaiable storage backends + List available storage backends bin/console storage set Set current storage backend diff --git a/src/Module/Attach.php b/src/Module/Attach.php index eed1275c58..dd4e368058 100644 --- a/src/Module/Attach.php +++ b/src/Module/Attach.php @@ -18,11 +18,9 @@ use Friendica\Model\Attach as MAttach; class Attach extends BaseModule { /** - * @brief Module initializer - * - * Fetch an attached file given the id + * @brief Return to user an attached file given the id */ - public static function init() + public static function rawContent() { $a = self::getApp(); if ($a->argc != 2) { @@ -64,4 +62,4 @@ class Attach extends BaseModule exit(); // NOTREACHED } -} \ No newline at end of file +}