Skip to content

Commit

Permalink
FIX: Лента (показ всех постов)
Browse files Browse the repository at this point in the history
+ добавим обработку (image/webp)
  • Loading branch information
evgip committed Apr 5, 2023
1 parent 9cd4faf commit da58cf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Core/UploadImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static function createDir($path)
public static function fileTypeCheck($type, $redirect)
{
// permitted
$types = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'];
$types = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'image/webp'];
if (!in_array($type, $types)) {
is_return(__('msg.five_format'), 'error', $redirect);
}
Expand Down
10 changes: 6 additions & 4 deletions app/Models/HomeModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ public static function display($type)
case 'deleted':
$display = "AND post_is_deleted = 1";
break;
case 'feed':
case 'top':
$display = "AND post_is_deleted = 0 AND post_votes >= $countLike AND post_tl <= " . $trust_level;
break;
default:
case 'all':
$display = "AND post_is_deleted = 0 AND post_tl <= " . $trust_level;
break;
default:
$display = "AND post_is_deleted = 0 AND post_votes >= $countLike AND post_tl <= " . $trust_level;
if (UserData::checkActiveUser()) {
$display = "AND post_is_deleted = 0 AND post_tl <= " . $trust_level;
}
}

return $display;
Expand Down

0 comments on commit da58cf3

Please sign in to comment.