mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 16:51:36 +02:00
check for site owner instead of crashing on missing current_site
This commit is contained in:
parent
1afb5da0bb
commit
951e66861e
2 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,7 @@ get '/site/:username/stats' do
|
|||
|
||||
stats = stats_dataset.all.reverse
|
||||
|
||||
if params[:format] == 'csv'
|
||||
if current_site && @site.owned_by?(current_site) && params[:format] == 'csv'
|
||||
content_type 'application/csv'
|
||||
attachment "#{current_site.username}-stats.csv"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue