mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
fix: exclude passworded pastes from discover and archive
This commit is contained in:
parent
24f8a6a9aa
commit
6c0f26f20f
3 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,7 @@ class Paste extends Model {
|
|||
->orderBy('updated_at', 'DESC')
|
||||
->where('visible', self::VISIBILITY_PUBLIC)
|
||||
->where('is_hidden', false)
|
||||
->where('password', null)
|
||||
->whereRaw("((expiry IS NULL) OR ((expiry != 'SELF') AND (expiry > NOW())))")
|
||||
->limit($count)->get();
|
||||
}
|
||||
|
@ -89,6 +90,7 @@ class Paste extends Model {
|
|||
->orderBy('views')
|
||||
->where('visible', self::VISIBILITY_PUBLIC)
|
||||
->where('is_hidden', false)
|
||||
->where('password', null)
|
||||
->whereRaw("((expiry IS NULL) OR ((expiry != 'SELF') AND (expiry > NOW())))")
|
||||
->limit($count)->get();
|
||||
}
|
||||
|
@ -98,6 +100,7 @@ class Paste extends Model {
|
|||
->whereRaw('MONTH(created_at) = MONTH(NOW())')
|
||||
->where('visible', self::VISIBILITY_PUBLIC)
|
||||
->where('is_hidden', false)
|
||||
->where('password', null)
|
||||
->whereRaw("((expiry IS NULL) OR ((expiry != 'SELF') AND (expiry > NOW())))")
|
||||
->orderBy('views')
|
||||
->limit($count)->get();
|
||||
|
|
|
@ -21,6 +21,7 @@ $pastes = Paste::with([
|
|||
])->select(['id', 'user_id', 'title', 'expiry', 'created_at', 'updated_at'])
|
||||
->where('visible', Paste::VISIBILITY_PUBLIC)
|
||||
->where('hidden', false)
|
||||
->where('password', null)
|
||||
->whereRaw("((expiry IS NULL) OR ((expiry != 'SELF') AND (expiry > NOW())))");
|
||||
|
||||
// if (!empty($_GET['q']) && is_string($_GET['q'])) {
|
||||
|
|
|
@ -31,6 +31,7 @@ $pastes = Paste::with([
|
|||
->select('id', 'user_id', 'title', 'created_at', 'updated_at')
|
||||
->where('visible', Paste::VISIBILITY_PUBLIC)
|
||||
->where('hidden', false)
|
||||
->where('password', null)
|
||||
->whereRaw("((expiry IS NULL) OR ((expiry != 'SELF') AND (expiry > NOW())))");
|
||||
|
||||
if (!empty($filter_value)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue