Commit Graph
100 Commits
Author SHA1 Message Date
evazion 0ed2dafdce /iqdb_queries: make available to anonymous users. 2017-07-06 19:18:45 -05:00
evazion 216243a354 /forum_posts/search: make available to anonymous users. 2017-07-06 19:18:15 -05:00
evazion 3a8cae4de1 /notes/search: make available to anonymous users. 2017-07-06 19:16:43 -05:00
evazion d8f8983f94 /uploads/report_tags: make available to anonymous users. 2017-07-06 19:16:03 -05:00
evazion ecf5040160 /uploads: make available to anonymous users. 2017-07-06 19:14:17 -05:00
evazion bef02e0ac1 /wiki_pages/search: make available to anonymous users. 2017-07-06 19:12:17 -05:00
evazion ef1db967f7 /dmails: allow banned users to read/delete dmails. 2017-07-06 18:39:42 -05:00
evazion cda1ee3d88 /users: allow banned users to edit account settings.
The member_only check prevents banned users from editing their account
settings. This isn't needed since check_privilege handles the privilege check.
2017-07-06 18:39:42 -05:00
evazion cc54c16fac /artists/show_or_new: make public; add "artist doesn't exist" page.
* Fix access denied error when anonymous users open /artists/show_or_new.

* When the artist doesn't exist, take user to "artist doesn't exist"
  page instead of redirecting to /artists/new.
2017-07-06 18:37:13 -05:00
evazion e5598be20e Factor out artists/show view into artists/_show layout. 2017-07-06 18:15:12 -05:00
evazion 68bf355542 upload tags report: add blacklist controls (#3121). 2017-07-05 19:40:48 -05:00
evazion aac1463fbf implications: count 'queued' implications as active.
Bug: implications that were approved but that were still in the 'queued'
state were not seen as active yet, which led to the transitivity
validation passing because it didn't include queued implications.
2017-07-05 00:22:27 -05:00
evazion 542c673221 Fix #3200: Disallow creation of superfluous implications.
Disallow transitive implications. If a -> b -> c already exists, don't
allow a -> c.

Caveat: if b -> c already exists, and we make a BUR for a -> b and a -> c,
the BUR validates even though a -> c is redundant. It only fails
when the BUR is approved.
2017-07-05 00:22:16 -05:00
evazion cda35494a4 Disable blacklists on pages without blacklist controls. (#3183) 2017-07-03 15:10:36 -05:00
evazion c3ac4f3329 Fix #3197 - Post Replacement comment: use Replacement URL instead of Final Source
Record the URL of the image that was actually downloaded as the replacement URL.
2017-07-02 21:00:26 -05:00
evazion 5a2745ee71 Fix post replacement controller test.
Broken in 27aa9fe. Delayed jobs have to be enabled when creating a
replacement, otherwise replacement will try to immediately delete the
existing files, which fails because they're still in use.
2017-07-01 13:37:32 -05:00
evazion 0390039621 Fix expunging posts from S3 (fixup 4c4ef5c / #3180). 2017-07-01 12:30:59 -05:00
evazion f8ed7d4357 tests: fix HTTP requests failing due to webmock (#3039).
Fixes failures in source tests caused by Webmock disabling non-stubbed
HTTP requests by default.

https://github.com/bblimke/webmock#real-requests-to-network-can-be-allowed-or-disabled
2017-07-01 12:22:36 -05:00
evazion 1c06ae9f81 atom feeds: fix deprecation warnings in *_path helpers.
DEPRECATION WARNING: You are calling a `*_path` helper with the
`only_path` option explicitly set to `false`. This option will stop
working on path helpers in Rails 5. Use the corresponding `*_url` helper
instead.
2017-07-01 11:45:28 -05:00
evazion 71f84b10af tumblr: convert commentary to dtext.
* Convert Tumblr commentary to DText.
* Strip extraneous whitespace in links and blockquotes.
* Add newlines after block elements to ensure they're separated from
  subsequent blocks.
2017-07-01 11:15:48 -05:00
evazion b880b07387 sources: factor out html-to-dtext code to DText.from_html. 2017-07-01 11:15:48 -05:00
evazion e3a4bfd28c /upload/batch: use image proxy for embedded thumbnails. 2017-06-27 13:46:59 -05:00
evazion 281ddae35d /uploads/batch: add thumbnail previews (#3194). 2017-06-27 13:31:47 -05:00
evazion 9c50b24306 post replacements: add "Tags" field to dialog box.
* Adds a "Tags" field to the post replacement dialog box. The given tags
  are added to the post after replacement.

* Prefills the Tags field with certain tags that usually need to be
  removed after replacement: replaceme, image_sample, jpeg_artifacts, etc.
2017-06-26 18:17:16 -05:00
evazion 8d22ab9de8 post replacements: record upload source/filename in replacement_url.
* Record "file://#{filename}" as the replacement url when the
  replacement comes from an uploaded file.

* Record the actual url downloaded by the upload process otherwise. This
  may be different from the url given by the user, since the upload
  process may rewrite the url.
2017-06-26 14:18:57 -05:00
evazion 4fd1c6ec21 /post_replacements: fix broken source links (missing href). 2017-06-26 10:26:58 -05:00
evazion 465be6bdf5 /post_replacements: fix thumbnails of deleted posts not showing. 2017-06-26 10:25:57 -05:00
evazion fbb25666b0 tumblr: add source tests. 2017-06-25 15:34:15 -05:00
evazion 030052bf14 tumblr: rewrite html pages to image url. 2017-06-25 15:34:15 -05:00
evazion 118843b26a tumblr: fetch tags, commentary, and image urls. 2017-06-25 15:34:15 -05:00
evazion d5ce6c98ef tumblr: add tumblr api client. 2017-06-25 15:34:15 -05:00
evazion c25ca4c45c {approvals,disapprovals}/create.js.erb: fix indentation. 2017-06-25 11:09:07 -05:00
evazion 791cbbf23b Fix #3186: Mod queue: hide item even if approve/reject fails. 2017-06-25 11:08:05 -05:00
evazion 5605f0fe0b Fix #3185: Dmail Show View incorrectly using class instead of ID. 2017-06-25 10:39:49 -05:00
evazion 4681812607 /artist_commentary_versions: format commentary as dtext. 2017-06-25 10:28:46 -05:00
evazion 1889864049 /artist_commentary_versions: show post thumbnails.
Show thumbnails in the /artist_commentary_versions listing. Don't show
thumbnails when viewing the version history of a single post.
2017-06-25 10:27:43 -05:00
evazion 6329d089ee post replacements: add tag match field to search form. 2017-06-22 17:03:05 -05:00
evazion 8b4e598a12 post replacements: add /post_replacements view. 2017-06-22 17:03:05 -05:00
evazion 13d49467a2 post replacements: fix search[creator_name]=... param. 2017-06-22 16:53:20 -05:00
evazion 41b9a8a044 post replacements: fix post_replacements_path helper.
Bug: `post_replacements_path` returned the wrong path because the
`/posts/:post_id/replacements` route took precedence over the
`/post_replacements` route.

Fix: declare the `/post_replacements` route first so that it takes
precedence instead.
2017-06-22 16:53:20 -05:00
evazion d3e8937716 post replacements: allow replacing with an uploaded file. 2017-06-22 16:52:55 -05:00
evazion c27668d2ef post replacements: add option to fix source after replacement.
Adds a "Final Source" field to the post replacement dialog. If
specified, the post's source field will be changed to this value after
replacement.

This makes fixing the source back to the HTML page after
replacement easier.
2017-06-22 16:51:55 -05:00
evazion 55512130e1 css: set text fields in dialogs to 100% width.
* Fixes the flag reason field being too small in the flag dialog
* Fixes the source field being too small in the post replacement dialog.
2017-06-22 14:19:28 -05:00
evazion 421bbc35a2 tumblr: rewrite samples to biggest available version. 2017-06-21 22:30:53 -05:00
evazion a9b3d28215 tumblr: fix edgecastcdn.net rewrite + add test.
https://data.tumblr.com doesn't have a valid SSL cert, so we must use
http:// instead when we rewrite to it.
2017-06-21 21:10:07 -05:00
evazion 16a51533bc tests: refactor tumblr tests to use assert_downloaded. 2017-06-21 21:10:07 -05:00
evazion 5684ba3b1d tests: factor out assert_downloaded to DownloadTestHelper. 2017-06-21 21:10:07 -05:00
evazion dc36476d50 nijie: don't return bogus artists when artist finder finds no match. 2017-06-20 17:09:57 -05:00
evazion 294358b4a6 nijie: fetch image_urls for batch bookmarklet. 2017-06-20 16:29:31 -05:00
evazion 2d5fc191dd nijie: convert commentary to dtext. 2017-06-20 16:11:16 -05:00
evazion 25e7db860a nijie: fetch artist commentary. 2017-06-20 16:11:16 -05:00
evazion 3560bbbd47 pawoo: don't return bogus artists when artist finder doesn't find a match. 2017-06-19 17:10:02 -05:00
evazion 655e53fe65 pawoo: rewrite /small/ images to /original/ 2017-06-19 17:10:02 -05:00
evazion 14196f36d8 pawoo: convert commentary to dtext. 2017-06-19 17:10:02 -05:00
evazion 6edb5a807b pawoo: fetch tags and commentary. 2017-06-19 17:10:02 -05:00
evazion 1bfc0a7d8a pawoo: get status id from normalized url. 2017-06-19 17:09:57 -05:00
evazion e91942dff3 pawoo: add source tests and docs. 2017-06-19 17:09:57 -05:00
evazion a60520ef6a pawoo: add credentials to default config. 2017-06-19 17:08:52 -05:00
evazion 77c78430db pawoo_api_client.rb: convert tabs to spaces. 2017-06-19 17:08:52 -05:00
evazion d40acc4e25 /comments: add IDs differentiating group_by=post/group_by=comment (fixes #3152). 2017-06-18 22:36:20 -05:00
evazion 87da9ec873 /comments: break out index_by_post/index_by_comment into partials. 2017-06-18 22:32:51 -05:00
evazion 128e655aef twitter: fetch hashtags for translated tags (fixes #3171). 2017-06-17 16:15:23 -05:00
evazion 8c7c2a06e5 notes: convert internal links to Danbooru to relative urls. 2017-06-17 11:57:32 -05:00
evazion 48001c1293 gems: update sanitize to 4.5.0; add addressable. 2017-06-17 11:57:32 -05:00
evazion 835f5d5426 Merge pull request #3169 from evazion/fix-upload-nil-source
Fix #3168: API upload can't handle unset source.
2017-06-17 08:40:03 -05:00
evazion ef76ec0385 uploads: fix upload failure when given nil source (fix #3168). 2017-06-17 08:31:44 -05:00
evazion 94e48aa6f3 pixiv: convert commentary to dtext.
Convert pixiv links to dtext in this manner:

* https://www.pixiv.net/member_illust.php?mode=medium&illust_id=1234
  => pixiv #1234 "»":[/posts?tags=pixiv:1234]

* https://www.pixiv.net/member.php?id=1234
  => "user/1234":[https://www.pixiv.net/member.php?id=1234] "»":[/artists?search[url_matches]=https://www.pixiv.net/member.php?id=1234]
2017-06-16 18:42:37 -05:00
evazion c638ff2e9c pixiv: fix nil commentary fields to empty string. 2017-06-16 18:42:37 -05:00
evazion 1a998cb3fb Move API methods from initializer to ApplicationRecord. 2017-06-16 13:28:31 -05:00
evazion c1834ab8dd Inherit models from ApplicationRecord instead of ActiveRecord::Base. 2017-06-16 13:28:31 -05:00
evazion 5dd3151d5b twitter: convert commentary to dtext.
* Convert hashtags and mentions to dtext links.
* Replace http://t.co urls to the actual url.
* Strip the http://t.co url linking to the tweet itself.
2017-06-16 12:56:55 -05:00
evazion 9909ff20cd twitter: memoize api response. 2017-06-16 12:56:55 -05:00
evazion 91ed793120 notes: mark links as nofollow. 2017-06-15 22:58:22 -05:00
evazion 845b278b1e notes: make allowed css properties explicit. 2017-06-15 22:58:22 -05:00
evazion 9570bf026c notes: allow <rtc>, <sub>, <sup>, <hr>, <wbr> tags. 2017-06-15 22:58:22 -05:00
evazion 869ccad6ba notes: allow all elements to have style/title attributes. 2017-06-15 22:58:14 -05:00
evazion 85e32b5eb2 notes: add sanitization tests. 2017-06-15 22:58:13 -05:00
evazion 990f173b3d notes: move sanitization from d_text.rb to note_sanitizer.rb. 2017-06-15 22:58:13 -05:00
evazion aef7fcd34c /static/bookmarklet: update bookmarklet description.
Better explain what the bookmarklet does, why it should be used, and how
to install it.
2017-06-15 22:29:18 -05:00
evazion b80111ea05 /static/bookmarklet: fix typo in page id. 2017-06-15 22:29:18 -05:00
evazion 4806297fde /static/bookmarklet: use HTTPS in bookmarklet if connected via HTTPS. 2017-06-15 22:28:14 -05:00
evazion 5c6eb0f475 posts: remove unused update_iqdb method.
Unused since 7aab50f.
2017-06-14 21:31:30 -05:00
evazion d84feaa4bb posts: fix expunging posts not removing image from iqdb.
`File.exists?(preview_file_path)` is always false because the file has
already been deleted by this point. Remove the check entirely.
2017-06-14 21:31:30 -05:00
evazion b27f98dc58 posts: fix expunging posts to delete files only after transaction succeeds. 2017-06-14 21:31:30 -05:00
evazion a844a1daf4 posts: fix expunging posts not deleting files.
Fix expungement to ignore the "file still in use" check.
2017-06-14 21:31:24 -05:00
evazion cdef9fda7d tests: fix send_message in post/pool archive helpers.
Since efe5e0e send_message is called with an extra param; fix mocked
send_message to handle this param.
2017-06-14 14:13:52 -05:00
evazion 155faf8380 commentaries: merge versions (fix #3149). 2017-06-14 13:52:24 -05:00
evazion 1ffc9d286c Fix User#can_view_flagger?. 2017-06-14 12:08:25 -05:00
evazion caebdef9fd commentaries: trim whitespace from existing commentaries. 2017-06-13 16:42:30 -05:00
evazion f8afabd51c commentaries: trim whitespace from fields. 2017-06-13 16:42:30 -05:00
evazion 1aafdc3928 commentaries: migrate columns to non-null. 2017-06-13 16:42:29 -05:00
evazion abb7117996 commentaries: add tests. 2017-06-13 15:13:53 -05:00
evazion 27aa9fe82a post replacements: don't delete files still in use.
Bug: if a user replaces a post with another image, then replaces the
post back to the original image, then the deletion job for the original
image will still run. The will delete the original file, but that file
is now in use again and should not be deleted.
2017-06-13 02:20:23 -05:00
evazion a1c9f34027 Fix #1908: Allow E shortcut to work on upload page. 2017-06-12 20:28:56 -05:00
evazion c06ae5277e Fix #1608: Show wiki page of alias consequent for Related Tags
Make related tags apply aliases before fetching tags from the wiki page.
2017-06-12 19:52:19 -05:00
evazion 1f2840917f /post_versions: fix taglist to wordbreak between tags. 2017-06-11 13:48:13 -05:00
evazion f3f55daea6 Fix #3138: Support DeviantArt login-only works. 2017-06-10 10:34:51 -05:00
evazion 5f9fce7343 Fix #3139: XSS in Related Tags javascript. 2017-06-09 20:40:07 -05:00
evazion 82c7537270 deviantart: force commentary encoding to utf-8. 2017-06-09 13:19:24 -05:00
evazion 2fcd823eff deviantart: add source tests. 2017-06-09 13:19:24 -05:00