diff --git a/includes/Models/Paste.php b/includes/Models/Paste.php index 04794ee..550aba6 100644 --- a/includes/Models/Paste.php +++ b/includes/Models/Paste.php @@ -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(); diff --git a/public/api/ajax_pastes.php b/public/api/ajax_pastes.php index b1ad931..719602a 100644 --- a/public/api/ajax_pastes.php +++ b/public/api/ajax_pastes.php @@ -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'])) { diff --git a/public/archive.php b/public/archive.php index 9d2afa0..40cc1d1 100644 --- a/public/archive.php +++ b/public/archive.php @@ -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)) {