Commit Graph
100 Commits
Author SHA1 Message Date
evazion 07a4bdcb21 posts: display validation warnings in flash notice. 2017-11-25 17:03:32 -06:00
evazion b62b16b5a2 Fix #3398: Show "(deleted)" next to topics in forum searches. 2017-11-24 15:58:45 -06:00
evazion 0b5ed163fe Fix #3395: fix pixiv API exception when uploading bad pixiv id images.
Fixes an exception when attempting to upload a Pixiv image from a
deleted work. The download strategy tries to fetch the source data in
the course of rewriting the URL, which fails if the work has been
deleted from Pixiv.

Raise a BadIDError and leave the URL as-is (don't rewrite it).
2017-11-21 14:40:39 -06:00
evazion 183a7e07e3 pixiv: fix failbooru when uploading bad pixiv id posts.
Fixes an "incompatible character encodings: UTF-8 and ASCII-8BIT"
exception when uploading a deleted Pixiv post.

Caused by the Pixiv API error message not having the encoding set to UTF-8.
2017-11-21 14:11:59 -06:00
evazion 5ba63733d3 download/pixiv_test.rb: fix broken pixiv download tests.
This post was deleted:

  http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46304614

Switch to this instead:

  http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46324488
2017-11-21 13:48:07 -06:00
evazion a14c492020 Fix #3396: Pixiv novel cover IDs are parsed incorrectly. 2017-11-21 13:03:03 -06:00
evazion f8581c8113 Fix #3321: HTML tags not converted in artist commentaries. 2017-11-21 02:42:49 -06:00
evazion b3a9cd6c06 Fix Post.fast_count("pool:1537") == 0 (fixup 134958d1).
Fixup for a bug in 134958d1. `Post.fast_count("pool:1537")` still
returned zero because `Tag.is_simple_tag?` incorrectly parsed
"pool:1537" as a simple tag, so Post.fast_count still looked for it in
the tags table and found the empty "pool:1537" tag.
2017-11-20 21:21:36 -06:00
evazion df7648b581 Fix #3392: Add safe mode account setting. 2017-11-20 18:59:53 -06:00
evazion 134958d137 Fix #3390: Searching certain metatags results in an empty paginator
Fixes Post#get_count_from_cache to only lookup the count in the tags
table when the search is for a single "simple" tag.

Check memcache when the search is not a simple tag:

* multi-tag searches (touhou rating:s)
* single metatag searches (rating:s, source:"foo bar")
* negated tags (-touhou)
* wildcard tags (*touhou*)
* or searches (~touhou)
2017-11-20 14:41:02 -06:00
evazion 7034a96048 Purge invalid gentags from tags table (#3390).
Purges gentags with invalid names from the tags table. Addresses #3390
(Searching certain metatags results in an empty paginator) by removing
metatags from the tags table.
2017-11-20 12:47:30 -06:00
evazion 9b887c3c3a Fix #3387: Safebooru: Two tag searches fail for members.
Makes the `rating:s` and `-status:deleted` tags not count against the
tag limit.
2017-11-19 20:58:22 -06:00
evazion 40d0751e83 Fix NoStrategyError during artist url normalization (#3382).
Fixes a bug from 9a3824a. When an artist entry is saved, `ArtistUrl.normalize`
is called on every URL, which calls `Sources::Site.new(url)`. This
raised NoStrategyError when an artist entry contained URLs that weren't
recognized by any strategy.

This also caused `Fetch source data` to fail in certain cases when it
attempted to find the artist.
2017-11-19 10:49:30 -06:00
evazion fa22e419af Fix #3385: Bookmarklet sets wrong source for Tumblr posts
Due to missing || operators, for Pawoo/Tumblr/Artstation uploads the
source wasn't changed from the direct image URL to the html page URL
after upload.
2017-11-18 15:44:16 -06:00
evazion 5837b74de4 tumblr: fix exception when fetching source data.
Fixes an `undefined method `gsub' for nil:NilClass` exception when fetching source
data for this url:

* /uploads/new?url=https%3A%2F%2Fuiti-ukumo.tumblr.com%2Fpost%2F156157443158%2F2016-12

Bug introduced in 3c524aa5: `url` wasn't initialized due to `@url = url`
being removed from Sources::Site#initialize.
2017-11-18 15:44:09 -06:00
evazion f896c24d37 tumblr: fail more gracefully if API key is not configured. 2017-11-18 13:53:11 -06:00
evazion 2422ce036c tumblr_test.rb: fix test failures. 2017-11-18 13:52:30 -06:00
evazion 22c9cfcec5 Fix #3384: Fetch commentary not creating fully formed textile links 2017-11-18 13:02:50 -06:00
evazion 6b8bc318b5 deviantart_test.rb: fix test failures. 2017-11-18 13:00:18 -06:00
evazion 05dea309b2 Fix search box rendering above tag edit dialog box (fix #3383). 2017-11-18 09:38:00 -06:00
evazion 26679dd7ab Fix #3323: Exclude post replacements from Mod Actions. 2017-11-17 13:21:36 -06:00
evazion 93767c3023 Fix post replacement test failure. 2017-11-17 13:21:35 -06:00
evazion 3df404dbd9 Fix #3380: Change category on Bulk Update Requests are broken. 2017-11-17 12:19:39 -06:00
evazion 07d20f7cf0 Add test for category <tag> -> type bulk update requests. 2017-11-17 12:15:38 -06:00
evazion eeb41d2ffd twitter: get status id from referer url if not in direct url. 2017-11-16 13:29:58 -06:00
evazion f633222ef0 twitter: test fetching source data from direct image with referer. 2017-11-16 13:29:58 -06:00
evazion 3cf753c540 Fix forum_post_id not being saved by alias/implication requests.
`forum_post_id` failed to save due to mass-assignment protection.

This caused alias approval messages ("The tag alias foo -> bar (forum #1234) has been approved.")
to not include the "(forum #1234)" bit because the forum id was nil.
2017-11-15 19:12:13 -06:00
evazion b5d602836c Don't send @mention dmails when updating forum after approving BURs. 2017-11-15 19:12:13 -06:00
evazion f2351766c6 Fix #3374: List approver in BUR approval messages. 2017-11-15 19:12:12 -06:00
evazion 60d5983bb7 aliases/implications: refactor to share approve/reject messages. 2017-11-15 18:32:20 -06:00
evazion 12640a6766 Fix tag alias test failures. 2017-11-15 16:58:58 -06:00
evazion 514d4f9c2e /uploads/new: trigger Fetch source data automatically on source change.
On the uploads page, trigger `Fetch source data` automatically when the
user pastes an URL into the source field. Silently ignore invalid URLs
so that we don't trigger spurious errors when the user types in a source
manually.
2017-11-15 10:47:17 -06:00
evazion 60844845e4 Fetch source data: avoid redundant /artist/finder.json call.
On the uploads page, don't call /artist/finder.json to find the artist
on page load. Instead have `Fetch source data` fill in the artist using
the `artists` data returned by the `/source.json` call.
2017-11-15 10:45:36 -06:00
evazion 487fe9fb5d Fetch source data: list Danbooru artist tag; elim duplicated code.
* In the `Fetch source data` box, list the Danbooru artist tag(s) that
  were found beside the artist name.

* Unify `Fetch source data` code that was duplicated between the
  uploads page and the post show page.
2017-11-14 23:29:29 -06:00
evazion cbd68ac91b /source.json: do artist lookup and return matches in artists. 2017-11-14 23:28:25 -06:00
evazion 58018aeb2b artists: move artist finding code from controller to model. 2017-11-14 23:27:47 -06:00
evazion 56bf518e6d Fix #3371: Add CSS classes to tag categories in the split tag list. 2017-11-14 19:51:47 -06:00
evazion 5f39a8b4b2 Fix #3365: Incorrect tag category counts.
`Hash[array]` didn't work because Hash needed to be called as `Hash[*array]`. Or,
more simply, `array.to_h`.
2017-11-13 21:45:12 -06:00
evazion 6d8143a9eb Fixup typo in 6fbd7c23 (#3363).
Fixes accidental clobbering of the `@@categories` variable used by
`TagCategory.categories`.
2017-11-13 20:27:03 -06:00
evazion 6fbd7c23e1 Fix #3363: Prevent setting tags to invalid categories. 2017-11-13 16:56:57 -06:00
evazion 91d25475a9 Fix #3312: Unneeded case sensitivity on tag searches 2017-09-27 11:46:23 -05:00
evazion 5a6cc84817 favorites: don't regen fav count when adding favorites.
Don't randomly regen the fav count when favoriting a post. This was a
workaround for #1210 that is no longer needed.
2017-09-13 13:29:35 -07:00
evazion af42740ca9 expunge: decrement user favorite counts. 2017-09-13 13:29:35 -07:00
evazion fd9dc6f647 expunge: decrement upload and note/post update counts (fix #2062). 2017-09-13 13:29:35 -07:00
evazion b69bf61f9f /artist_commentary_versions: fix body field being duplicated.
ref: https://danbooru.donmai.us/forum_topics/9127?page=197#forum_post_134924
2017-08-21 15:25:48 -05:00
evazion 9d28a2491a Fix #3270: Filter tag search results for deleted wikis. 2017-08-15 23:42:43 -05:00
evazion b215d2112d wiki pages: normalize unicode in other names. 2017-08-12 17:15:19 -05:00
evazion 9b031a9c20 Fix #3266: Normalize fullwidth Unicode characters in translated tags. 2017-08-12 17:13:52 -05:00
evazion 6797f8564d upload limits: show full upload limits on upload page. 2017-08-10 23:58:58 -05:00
evazion 1ef363dd68 upload limits: add time remaining until next upload to profiles (fix #3262). 2017-08-10 23:58:58 -05:00
evazion bf3101da48 upload limits: show how upload limits are calculated in profiles.
* Allow mousing over the upload limit on profile pages to show the full
  formula for the upload limit calculation. In particular, show how the
  upload limit multiplier is derived from the deletion confidence.

* Refactor to avoid duplicating upload limit calculations in the
  presenter, as much as possible.
2017-08-10 23:48:50 -05:00
evazion 3b3abac8f6 pools: disallow asterisks and numeric-only names. 2017-08-10 18:37:22 -05:00
evazion 3b9a54f681 pools: strip leading/trailing, consecutive underscores in names (fix #3263). 2017-08-10 18:33:36 -05:00
evazion c270954991 Fix #3258: Fetch source data broken for https://i.pximg.net/* ugoiras. 2017-08-06 17:23:29 -05:00
evazion 2b9393a624 twitter: remove unused TwitterApi class (#3206). 2017-08-05 23:12:55 -05:00
evazion 8b70e0099b twitter: fix to handle extended tweets (fix #3254, #3072). 2017-08-05 23:12:55 -05:00
evazion b23f92fa10 Fix #2502: Exclude empty commentary from searches. 2017-08-05 18:32:31 -05:00
evazion 69d4712708 mentions: process mentions added in an edit (fix #2736) 2017-08-04 23:48:53 -05:00
evazion 4c54e18c6d mentions: factor out mention parsing to DText.parse_mentions. 2017-08-04 23:48:31 -05: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
evazion 7b96d9dcd4 Fix 'Deleted post filter' option applying to status:{any,all} (#3245).
https://danbooru.donmai.us/forum_topics/9127?page=196#forum_post_134342
2017-08-04 17:15:39 -05:00
evazion a56c1bbb76 artists: fix validation error when url_string has leading spaces.
Bug: if the url_string had leading spaces, when it was split the
resulting array contained the empty string, which led to a validation
error when trying to save the urls.

Fixup for #3247.
2017-08-04 01:05:25 -05:00
evazion e2c2435356 Gemfile: update dtext to 1.5.1. 2017-08-04 00:47:43 -05:00
evazion 8142f74381 aliases/implications: add status/tag type/order search options. 2017-07-29 17:43:47 -05:00
evazion 49f5a1060e aliases/implications: factor out shared code. 2017-07-29 17:13:34 -05:00
evazion 04e9b8ebff Merge branch 'fix-3246' into master-albert 2017-07-29 15:00:35 -05:00
evazion 1000f8d2e2 Fix #3246: Require nonblank body for wiki pages. 2017-07-29 14:59:42 -05:00
evazion 624444d51d artists: validate that urls are well-formed (fix #2346). 2017-07-29 01:44:05 -05:00
evazion 10614d2152 artists: show success/error message when updating artists. 2017-07-29 01:44:05 -05:00
evazion 6121b8cb25 artists: simplify artist url saving code.
Refactor the way artist urls are saved so that artist url validations
run before the artist is saved, not after.
2017-07-29 01:41:37 -05:00
evazion 1c38fbbf64 Fix #2344: Negating status metatag breaks deleted post filter. 2017-07-28 19:52:35 -05:00
evazion 4b635628cc Fix #3243: Don't create new note versions when nothing is changed. 2017-07-28 17:41:05 -05:00
evazion 76b4b365ae post replacements: don't queue deletion when file is unchanged (#3235).
When replacing a post with the same file, don't queue a deletion and
don't leave a comment or modaction. There's no need to do these things
when we're restoring a missing or corrupted image with the original file.
2017-07-27 16:26:35 -05:00
evazion 80e8c9d174 strategies/pixiv.rb: removed unused methods (#3206).
The page count and the moniker are now obtained from the API.
2017-07-26 18:17:04 -05:00
evazion 7ae860a8b8 Drop Pixiv whitecube support (#2681, #3206). 2017-07-26 18:06:46 -05:00
evazion 22980c845a tests: fix pixiv ugoira urls. 2017-07-25 00:36:18 -05:00
evazion b53371b698 Fix #3235: Replacements deleting files currently in use. 2017-07-24 23:43:38 -05:00
evazion 11ef460db0 post replacements: allow replacing post with identical file. 2017-07-24 23:05:34 -05:00
evazion 67528ce5ab Fix hidden attribute leaks in legacy post controller (#3237). 2017-07-24 20:35:12 -05:00
evazion f2bf756422 Fix hidden attribute leaks in data attributes (#3237). 2017-07-24 20:35:12 -05:00
evazion 9893dc1734 Fix #3237: Meta tags expose posts with censored tags. 2017-07-24 19:40:35 -05:00
evazion 0129891213 Fix #1156: Allow sequential search navigator to work without a search. 2017-07-24 19:30:30 -05:00
evazion e3c45a9c70 danbooru_default_config.rb: add css_server, ccs_key. 2017-07-22 00:42:13 -05:00
evazion 96fddc5bec Fix #3234: Incorrect filesize on upload page. 2017-07-22 00:34:30 -05:00
evazion fffc107d4f Add order:{tagcount,gentags,arttags,chartags,copytags} metatags. 2017-07-21 23:11:02 -05:00
evazion 6682ae10eb /users/:id/edit: redirect back to settings instead of profile. 2017-07-21 01:18:42 -05:00
evazion bda285d97f Post#expunge!: simplify has_children flag logic. 2017-07-21 00:13:20 -05:00
evazion 44f6673d94 Post#expunge!: run callbacks when reparenting children.
* Set parent IDs with `update` instead of `update_column` /
  `update_all` when reparenting children. This fixes it so that new post
  versions are saved and the has_children flag is set on the new parent.

* Slightly simplify logic of update_children_on_destroy: the single
  child case is subsumed by the multi-child case.
2017-07-21 00:13:20 -05:00
evazion fbee7f6912 Post#expunge!: fix remove_pool! to remove posts from deleted pools.
Don't silently ignore attempts to remove posts from deleted pools.
Remove the restriction on removing posts from deleted pools instead (ref: #1109).

Fixes failure to remove posts from deleted pools during expungement.
2017-07-21 00:13:20 -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 bac8ff4de0 Post#expunge!: destroy post replacements on expunge. 2017-07-21 00:13:20 -05:00
evazion 3ed14ae782 Post#expunge!: wrap in transaction. 2017-07-21 00:13:20 -05:00
evazion 1fe6a5fc65 Fix #3225: Exception in NoteSanitizer#relativize_links. 2017-07-19 21:13:04 -05:00
evazion 93d44c6b84 Fix #3224: 403 Forbidden when logging in to DeviantArt.
Login fails if the User-Agent isn't set while POST'ing the login
credentials.
2017-07-19 20:25:27 -05:00
evazion 8125d8e796 Set the default User-Agent sent for outgoing http requests.
* Add a `Danbooru.config.http_headers` config option.

* Refactor various places to use this option instead of setting the user
  agent manually.
2017-07-19 20:25:27 -05:00
evazion 7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion 5d013f9c88 /dmails: remove max-width: 50em rule (#3185). 2017-07-19 15:30:14 -05:00
evazion b545a5e7f4 Fix related tags overflow in detachable tag edit dialog (fix #3219).
Bug: resizing the tag edit dialog then expanding the related tags
section doesn't resize the dialog to fit the expanded related tags
section. Instead a scrollbar appears.

Fixes this by expanding the dialog's height when the related tags are
shown.
2017-07-17 19:00:12 -05:00
evazion ffbf5bbcdf Factor out related tags visibility toggling code. 2017-07-17 18:58:20 -05:00
evazion 5d48244df4 Fix related tags overflow in detachable tag edit dialog (#3219).
Fixes these issues with the detachable tag edit dialog:

* Moving the edit dialog then expanding the related tags causes the
related tags to overflow outside the dialog.

* Expanding the related tags, moving the edit dialog, then collapsing
the tags causes the dialog to not resize back to its minimized size.
2017-07-17 18:29:06 -05:00