From 28c08467fd33d556e8e496351745773564aa2683 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 5 Apr 2017 22:30:12 +0200 Subject: [PATCH] Continued a bit: - added spaces/curly braces - used x($foo, 'bar') instead of isset($foo['bar']) - let's wrap html_entity_encode() somehow Signed-off-by: Roland Haeder --- include/attach.php | 5 ++-- include/bb2diaspora.php | 58 +++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/include/attach.php b/include/attach.php index 3232f3e76..ee6f49937 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1060,13 +1060,14 @@ function z_mime_content_type($filename) { 'zsh' => 'text/x-script.zsh', ); - $dot = strpos($filename,'.'); + $dot = strpos($filename, '.'); if ($dot !== false) { - $ext = strtolower(substr($filename,$dot+1)); + $ext = strtolower(substr($filename, $dot + 1)); if (array_key_exists($ext, $mime_types)) { return $mime_types[$ext]; } } + /// @TODO Then let's get rid of it? // can't use this because we're just passing a name, e.g. not a file that can be opened // elseif (function_exists('finfo_open')) { // $finfo = @finfo_open(FILEINFO_MIME); diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8d871a07b..95e236524 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -1,11 +1,11 @@