Commit Graph

8831 Commits

Author SHA1 Message Date
evazion
9322c596e2 Fix #4279: Very long tags break forum post format.
* Enable word breaks for all DText-formatted text. Ensures extremely
  long strings in comments get broken.

* Fix the author column on comments/forum posts to use a fixed 12em
  width (except on the mobile layout). Using flex-basis was wrong because
  it allowed the author column to shrink if the other column was too wide.
2020-02-05 16:49:04 -06:00
evazion
327bc46bd2 Fix #4283: Profile no longer viewable through API. 2020-02-05 15:39:53 -06:00
evazion
ccb87e13b1 Fix #4282: Related tag search no longer allows the JSON/XML formats. 2020-02-05 14:38:32 -06:00
evazion
2d0e0769cb /ip_addresses: add paginator to group_by=(user|ip_addr) pages. 2020-02-05 14:28:30 -06:00
evazion
089c304992 paginator: fix page counts for relations with group by clauses.
Fix an invalid SQL exception that occurs when the paginator tries to
do a COUNT(*) to calculate the page count of a relation that already
includes a GROUP BY + COUNT(*) clause. We need to nest the whole query
inside a `SELECT COUNT(*) FROM (...)` subquery so the inner COUNT(*)
doesn't mess up the outer COUNT(*).

Fixes #4285.
2020-02-05 14:27:48 -06:00
evazion
6b3c541a8a /ip_addresses: temp fix for exception when using group_by param.
Calling next_page here raises an exception when calculating the page
count because it can't handle SQL containing a GROUP BY clause. Swallow
the exception as a temp fix.
2020-02-04 03:59:10 -06:00
evazion
96b565f61d users: temp fix exception when is_banned is inconsistent.
Fix an exception when is_banned is true but the user doesn't have a ban
record.
2020-02-04 03:51:59 -06:00
evazion
fcfdd94fe9 controllers: temp fix exception in show actions.
Temp fix a regression caused by c7185724d.
2020-02-04 03:51:59 -06:00
evazion
6a729cf184 sessions/new: fix 'Missing partial static/_secondary_links' error. 2020-02-04 03:45:46 -06:00
evazion
6a3a04f6ec dmails: fix unread dmail notice when unread_dmail_count is inconsistent.
Fix an exception when the user's unread_dmail_count is nonzero but they
don't have any unread dmails. This normally shouldn't happen unless the
unread_dmail_count is inconsistent.
2020-02-04 03:45:27 -06:00
evazion
f87ec2509a modreports: fix reporting inaccessible dmails and forum posts.
* Fix it being possible to report dmails belonging to other users.
* Fix it being possible to report forum posts in mod-only threads.
2020-02-03 22:11:48 -06:00
evazion
a5ebbc04e8 dmails: fix shortlinks to include correct key. 2020-02-03 22:05:58 -06:00
evazion
0321b979d0 dmails: fix respond links being shown to non-owner on show page. 2020-02-03 22:05:58 -06:00
evazion
df2573359d mod reports: add show page redirect. 2020-02-03 22:05:58 -06:00
evazion
6ad5a6d50c Update dtext gem. 2020-02-03 22:05:58 -06:00
evazion
3c2a379d6f uploads: replace old upload limits with new upload limits. 2020-02-03 22:05:58 -06:00
evazion
24cb920608 mod reports: include reported user and message in forum post.
Also fix it so that reports against dmails include the key in the dmail
link so that mods can view the reported dmail.
2020-02-03 04:52:12 -06:00
evazion
bb2022abed mod reports: autoreport spam and autoban spammers.
* Automatically generate a mod report when a comment, forum post, or
  dmail is detected as spam.
* Automatically ban users that receive too many automatic spam reports
  within a short window of time.
* Automatically mark spam dmails as deleted.
* Change ban threshold from 10 spam reports in 24 hours to 10 reports in 1 hour.
* Change ban length from 3 days to forever.
2020-02-03 04:52:12 -06:00
evazion
170a0e8a48 dmails: remove ability to mark dmails as spam.
Instead of marking messages as spam, users can either report the message
or mark it as deleted.
2020-02-03 04:52:12 -06:00
evazion
b8aa223ecb dmails: fix users being able to update other user's dmails.
Fix it being possible to mark dmails belonging to other users as read or
deleted. Anyone who had a permalink to a dmail could update the dmail.
2020-02-03 04:48:50 -06:00
evazion
73219f38ce dmails: fix security issues with dmail permalinks.
Fix a couple security issues related to dmail permalinks. Dmails have a
permalink that you can give to a Mod to let them read the dmail. This is
done with a key param that grants access when the dmail is opened by
another user. The key param had several problems:

* The key contained a full copy of the message's title and body encoded in
  base64. This meant that anyone given a dmail permalink could read the
  full dmail just by decoding the key in the link, without even having
  to open the link.

* The key was derived from the dmail's title and body. If you knew or
  could guess a dmail's title and body you could open the dmail. One
  case when this was possible was when sending dmails. You could send
  someone a dmail, take the permalink from your sent copy of the dmail,
  then increment the dmail id to open the receiver's copy of the dmail.
  Since the sent copy and the received copy both had the same title and
  body, they both had the same dmail key. This let you check whether a
  person had read your dmail, and what time they read it at.

* The key verification was done with an insecure string comparison
  rather than a secure constant-time comparison. This was potentially
  vulnerable to timing attacks.

* Opening a dmail belonging to another user would mark it as read for them.

The fix to all this is to use the dmail's id as the key instead of the
dmail's title and body. This means that old permalinks no longer work.
This is unavoidable given the issues above.

Other changes:

* The name of the 'Permalink' link is now 'Share'.
* Anyone with the 'Share' link can view the dmail, not just Mods.
2020-02-02 22:27:49 -06:00
evazion
6468df6d44 dmails: allow marking dmails as unread.
* Add ability to mark dmails as unread.
* Fix users.unread_dmail_count to not count deleted dmails.
* Fix show action so that API calls don't mark dmails as read.
* Don't show the unread dmail notice on the /dmails page itself.
* Stop using users.has_mail flag.
2020-02-01 15:49:33 -06:00
evazion
067c6a10e7 upload limits: fix point cap being exceeded. 2020-01-31 16:25:06 -06:00
evazion
76630bbf73 dmails: remove search[read] param. 2020-01-31 16:25:06 -06:00
evazion
d8eba59cfa dmails: add unread folder, show only received messages by default.
* Add unread and deleted dmail folders.
* Remove dmail_folder cookie (wasn't used).
* Default to the received folder so that we don't show sent messages by default.
2020-01-31 16:24:53 -06:00
evazion
f8db577c25 dmails: replace hard deletions with soft deletions.
Turn deletions into soft deletions (set the is_deleted flag) instead of
hard deletions (remove from database). The is_deleted flag actually
already existed, but it was never used before.
2020-01-31 16:24:27 -06:00
evazion
5df8d08aae dmails: allow Members to mark dmails as spam.
* Allow Members to mark dmails as spam or not spam (previously Gold only).
* Replace spam and ham endpoints with single update endpoint.
2020-01-31 02:43:08 -06:00
evazion
ea45e44e10 search: remove legacy 'search[sort]' params.
Remove support for the `search[sort]` param on certain index pages. This
hasn't been used for years, and it caused the `search[order]=` param to
be added to pagination links even when the order was blank.
2020-01-31 02:43:08 -06:00
evazion
edfef10dc9 Fix #1883: Add <link> elements for all paginated pages.
Add <link rel="prev"> and <link rel="next"> elements to most pages with
pagination. This should work on all index pages, but it won't work for
things like pool or forum topic show pages.

Also remove the <link rel="top"> element (wasn't useful, was just a link
back to the root url).
2020-01-31 02:43:08 -06:00
evazion
c7185724d5 controllers: set @current_item globally in respond_with. 2020-01-31 02:43:08 -06:00
evazion
6b066f2cab Fix #4275: Unable to update "banned artist" entries.
Allow all users to view and edit artist entries and wiki pages belonging
to banned artists. There was little need to hide these pages from
Members, it was mainly to appease artists who didn't like us even
linking to their sites.

These restrictions also had multiple flaws:

* Banned artist information was still visible in the API.
* It was still possible to edit banned artists using the API.
* It was still possible for unprivileged users to revert banned
  artist entries or wiki pages to previous versions.
* The restrictions were inconsistent: in various places they were
  either Member-only, Gold-only, or Builder-only.
2020-01-31 02:43:08 -06:00
evazion
74d77c1e23 Update robots.txt.
* Generate /robots.txt dynamically.
* Include link to sitemap.
* Update list of allowed urls.
* Disallow crawling of non-canonical subdomains.
2020-01-31 02:43:07 -06:00
evazion
e715bfad8a Fix #4278: Certain users are unable to use the report function. 2020-01-30 12:35:05 -06:00
evazion
d29b88d43b models: fix apply_default_order being applied twice. 2020-01-27 17:39:58 -06:00
evazion
588280c8cc views: add embed_wiki helper.
Also remove options to configure names of wiki notice pages. These names
generally don't need to be changed and we already hardcode links to wiki
pages in other places anyway.
2020-01-27 17:14:38 -06:00
evazion
af044c45db mod reports: enable reporting for members, add dmail reporting.
* Add ability to report dmails.
* Enable reports for comments, forum posts, and dmails.
* Allow Members to send reports.
* Don't allow users to report the same thing twice.
2020-01-27 17:12:39 -06:00
evazion
812918556f api: fix *_lower params to downcase input. 2020-01-27 11:29:35 -06:00
evazion
a30c546417 search: fix embedded metatag to use truthy/falsy. 2020-01-27 11:29:29 -06:00
evazion
f76965a6a9 Merge pull request #4273 from BrokenEagle/normalize-array-search
Add parameters for searching attributes by array with case insensitivity
2020-01-27 00:54:33 -06:00
evazion
60dae29fed Merge pull request #4272 from BrokenEagle/fix-wiki-quick-search-check
Fix title parameter checking
2020-01-27 00:52:26 -06:00
evazion
092350caf2 Update ruby gems. 2020-01-27 00:47:36 -06:00
evazion
18affeb4e9 Add new upload limit system (fix #4234). 2020-01-27 00:47:35 -06:00
evazion
3d6084338c Raise statement timeout in development mode. 2020-01-27 00:47:35 -06:00
evazion
5925d3fa62 modqueue: fix typo in page_title. 2020-01-27 00:47:35 -06:00
evazion
aa442121bb views: refactor open graph / twitter <meta> tags.
* Fix og:site to og:site_name.
* Fix open graph properties to use <meta property="...">, not <meta name="...">>
* Set og:type, og:site_name, twitter:site globally (not just on post pages).
* Set og:url.
* Remove unused always-resize-images, report-server <meta> tags from
  post show pages.
2020-01-27 00:47:24 -06:00
evazion
aeec46b212 views: move inline javascript to app bundle. 2020-01-26 19:16:38 -06:00
evazion
2265721cb2 forum: move inline css to stylesheet. 2020-01-26 19:16:38 -06:00
evazion
c36c0b9e7a views: refactor atom feed links.
* Fix comment & forum feeds to include search params.
* Remove global post feeds (only include post feeds on post index).
2020-01-26 19:16:38 -06:00
evazion
815703a922 views: adjust more <meta> descriptions.
* Add <meta> descriptions to more pages.
* Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
2020-01-26 19:16:38 -06:00
evazion
fbe39148cd users: remove opt_out_tracking account setting.
This setting doesn't do anything any more. It was only ever used to
disable tracking of some (but not all) data in Mixpanel, then later in
Matomo.
2020-01-26 19:16:38 -06:00