Commit Graph
100 Commits
Author SHA1 Message Date
riking 83b51875bb Use html_escape method instead of gsub 2015-02-09 15:03:17 -08:00
riking 7e79daf9af SECURITY: missed html escaping 2015-02-09 14:34:05 -08:00
riking 380185e24a FEATURE: Make default locale settable during bootstrap 2015-02-09 11:15:41 -08:00
riking 8812f95839 FIX: Ember regression in read-only banner 2015-02-08 12:42:19 -08:00
riking 06f02ce9fc FIX: 🈂️ Allow closing polls in multi-locale sites 2015-02-05 19:55:03 -08:00
riking 193bf62dee FIX: 'all' filter never de-highlighting 2015-02-05 15:02:11 -08:00
riking 2154f5478a FEATURE: Mentions stream on user profile 2015-02-04 22:03:44 -08:00
riking 4c8850108a SECURITY: Don't leak topic title in the redirect 2015-02-04 11:55:39 -08:00
riking c6e27399b3 FIX: Add Google Analytics code to crawler view 2015-02-02 00:49:58 -08:00
riking 85a7b925c7 Miscellaneous fixes from PR#3000
FIX: Don't require login to view post raw
FIX: Don't submit read-guidelines for anonymous users (causes
unnecessary 403 errors from ensure_logged_in)
FIX: Don't pass nil to an array serializer
2015-01-29 13:56:32 -08:00
riking 0debca4278 FIX: 🈂️ Use site-wide locale for deletion stubs 2015-01-24 18:26:37 -08:00
riking 9e9119d1c1 FEATURE: Enable pagination of /posts.json 2015-01-23 21:22:19 -08:00
riking 1d24d8471e FEATURE: Latest posts endpoint at /posts.json 2015-01-23 21:16:03 -08:00
riking fb72e2665f PERF 🐎 Don't calculate preload data for non-xhr json requests
This will help out anyone querying as API instead of through a
browser.
2015-01-23 21:14:58 -08:00
riking 03fd275b45 FIX: Respect user locale for reply notifications 2015-01-17 23:17:50 -08:00
riking 1ab0d6bd82 FEATURE: Log username changes by staff
Also fix the tests for changing username
2015-01-17 02:26:12 -08:00
Kane York 31c8b5763f Set Turkish pluralization rules
Turkish does not have different forms for singulars next to numerals
https://meta.discourse.org/t/turkish-translation-missing-many-singular-strings/23334/
2015-01-14 10:39:31 -08:00
riking 399af512aa Update documentation for PostCreator 2015-01-05 07:52:33 -08:00
riking 728e8a262c FIX: Admin panel referral stats not counting topics correctly
Due to what seems to be a bug in ActiveRecord, the distinct: true option
is not recognized on counts with string column names. This commit fixes
that by moving the DISTINCT into the count string.

For robustness, the integration spec for IncomingLinksReport was
rewritten to be an actual integration spec, running the actual interface
on actual fake data.
2014-11-24 12:16:52 -08:00
riking d7a4e39e1d FEATURE: ?include_raw parameter for /t/id/posts.json
include_raw is not added for the wordpress view because it uses the
BasicPostSerializer, and is not a one-line change.

This is the only use of the TopicViewPostsSerializer class, and the
previous change covered the only use of the TopicViewSerializer class.
No other locations include the PostStreamSerializerMixin. Therefore,
this feature is most likely complete.
2014-11-07 07:28:07 -08:00
riking 37dbc4b5e6 Add archive.org to crawler list to serve no-js to 2014-11-02 16:51:23 -08:00
riking 6a946712b3 Add ?include_raw parameter to topic views 2014-11-01 14:32:18 -07:00
riking ef36a619c3 Update Markdown tests 2014-10-05 17:30:29 -07:00
Kane York b79c835c07 Fix data-* behavior (failure to understand own docs) 2014-10-05 15:11:26 -07:00
riking 0532468499 Fix JSHint 2014-10-05 14:58:48 -07:00
riking 1436f75a9f FEATURE: Allow explicit rel="nofollow" on links 2014-10-05 14:58:48 -07:00
riking 0586b3dd25 Clean up validateAttribute() function
Remove code duplication
2014-10-05 14:58:47 -07:00
riking 32cc31319f FIX: Use lang- prefixes for HLJS; add nohighlight for ...
text; use a proper whiteListTag() call.

Old posts are not affected - no global rebake is necessary.
2014-10-05 14:58:47 -07:00
riking 22a4ceceee Auto-anchor attribute regexes, document _validTags 2014-10-05 12:17:56 -07:00
riking e665bfd72a Fix test failure 2014-09-30 13:16:34 +10:00
riking bff95a6a97 Rename 'leader' -> 'tl3' 2014-09-30 13:16:34 +10:00
riking fa50723807 Fix wrong variable name 2014-09-30 13:15:14 +10:00
riking 760465959f Also skip locked users in the job query 2014-09-30 13:15:14 +10:00
riking 4aabc44264 Display grace period note even if not below requirements 2014-09-30 13:15:14 +10:00
riking 36b5f73e57 Change 24 hours to soon (it runs every 4 hours) 2014-09-30 13:15:14 +10:00
riking c8111ada6e FEATURE: Allow admins to lock users from TL3 promotion/demotion
Also, update the display logic for the leader promotion screen to
account for the demotion grace period.
2014-09-30 13:15:13 +10:00
riking 41d53c7222 FIX: Leader requirements weren't loading when visited directly 2014-09-30 13:15:13 +10:00
riking e69d084c88 Add trust_level_locked column 2014-09-30 13:15:13 +10:00
riking 34db30396c FIX: Bracked category link in no-JS view 2014-09-14 21:55:30 -07:00
riking 2c6d03f87f SECURITY: Limit passwords to 200 characters
Prevents layer 8 attack.
2014-09-12 12:07:11 -04:00
riking 056249cc93 PERF: Tame eager-loading of category definition topic URL
With this change, the EXPLAIN on the topic query is reduced in cost, and
script/bench.rb results are improved.

Explain topic query, cost at root level:

cost=641.84..641.92 --> cost=570.03..570.11

script/bench.rb result, 50th percentile:

BEFORE
---

categories_admin: 95
home_admin: 80
topic_admin: 33
categories: 71
home: 51
topic: 15

AFTER
---

categories_admin: 78
home_admin: 58
topic_admin: 49
categories: 40
home: 34
topic: 30
2014-09-10 19:55:10 -07:00
riking b62699707d FIX: Unknown /posts/id.json should 404 2014-09-10 18:10:27 -07:00
riking 637371e60a Switch to count of all notifications 2014-09-09 20:13:36 -07:00
riking bf06878601 FIX: Broken notification history 2014-09-09 17:25:25 -07:00
riking 5994b630b7 Final dirty diff cleanup 2014-09-09 16:29:08 -07:00
riking 69bc552054 FEATURE: Actually show more notifications
The "Show more notifications..." link in the notifications dropdown now
links to /my/notifications, which is a historical view of all
notifications you have recieved.

Notification history is loaded in blocks of 60 at a time.

Admins can see others' notification history. (This was requested for
'debugging purposes', though that's what impersonation is for, IMO.)
2014-09-09 16:29:08 -07:00
riking c1df25e856 Add test for "on day, name wrote" quote trigger 2014-09-09 16:27:06 -07:00
riking a0dccf7bc0 FIX: Add "On day, name wrote:" quote trigger for emails 2014-09-09 16:27:06 -07:00
riking 7bb1b8bc97 Handlebars structure tweaks to post.handlebars
- Combine bind-attrs on the <article> (seriously that made no sense)
 - Hoist a bind-attr class to the view, allowing more fancy styling
 - Hoist a <div> outside a conditional
 - Change href='#' to unvalued hrefs
2014-09-09 11:20:25 -07:00
riking 54484ca18a "FIX": Add error reporting to NotifyMailingListSubscribers
Also skip unactivated users, which may actually fix this
2014-09-03 14:53:05 -07:00
riking 824dadbc1b FIX: Add .cooked class to composer preview
This should make any custom styling apply to both the rendered posts and
the composer equally, as long as a .topic-body parent or a #wmd-preview
parent is not specified.
2014-09-03 13:18:48 -07:00
riking 71b7c80257 UX: CSS tweaks for badge query previews 2014-09-02 19:09:51 -07:00
riking 3cf493eb4f FIX: Apply contract checks when first creating a badge 2014-09-02 19:09:51 -07:00
riking 8979020b9d Clean up unused translations 2014-09-02 15:40:23 -07:00
riking 3413228e89 UX: Change Impersonate to btn-danger 2014-09-02 15:33:54 -07:00
riking ee812eb447 FIX: Do not perform grants if badges are disabled 2014-09-02 13:12:27 -07:00
riking 808460a28f Fix magic numbers, extra param references 2014-08-31 19:36:31 -07:00
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
riking 085b18577c Remove unnecessary user/topic load in PostCreator 2014-08-28 22:07:40 -07:00
riking 24ba7ccfbb FEATURE: Add a plugin callback when editing a post
FIX: Wrap PostRevisor database work in a transaction
2014-08-28 21:27:40 -07:00
riking 3396e6fea3 Centralize MessageBus post updates
After this change, only two files directly publish to MessageBus with a
topic interpolated in the channel: Post and TopicUser.
2014-08-28 20:40:36 -07:00
riking 0a7a4eae99 Publish lightboxing on the message bus
With this change, images appear to lightbox instantly on my development
machine.
2014-08-28 20:16:33 -07:00
riking 8ddd90daa4 Have parse_body() recover from ASCII-8BIT encoding
Added a test to make sure that the result can be passed into TextCleaner
(which expects UTF-8)
2014-08-28 14:38:19 -07:00
riking 1c9f6159cd Update the Receiver and PollMailbox specs for the changes
Tests are both added, moved, and deleted.

Add test for topic not being created

Move html_only.eml to parse_body testing section
2014-08-28 14:38:19 -07:00
riking 0a09593f3b FIX: Prefer HTML in incoming emails, heavily refactor email receiver
This commit heavily refactors Email::Receiver to both better handle
different emails and improve testability.

A primary focus of the refactor is reducing the usage of class
variables, in favor of actually passing parameters - making it possible
for multiple tests to use the same Receiver instance.

The EmailLog reported when a topic is created is reflected to put the
user's email in the to_address field, instead of the system address.

The discourse_email_parser function is renamed to
discourse_email_trimmer, and additional stopping conditions are added to
make up for EmailReplyParser's inability to deal with html at the start
of a line.

The force_encoding calls are refactored out to a 'fix_charset' method.

parse_body is renamed to select_body, and the scrub_html method is
dropped in favor of the new HtmlCleaner class.

A new parse_body method is added, which performs the job of the removed
lines of code in the 'process' method.

EmailUnparsableError is redefined again, to be encoding errors (when the
declared encoding is not what was delivered).
2014-08-28 14:36:10 -07:00
riking cb55ef4702 Add Email::HtmlCleaner for email processing
This class is in charge of stripping out most of the crap from the HTML
portion of emails that email clients generate, so that it can be sanely
post-processed for signatures and quoting boundaries.
2014-08-28 14:36:10 -07:00
riking 0d0225133c FIX: Failed incoming emails could create empty topics
A failure condition is eliminated where a topic would be created, but post
creation would fail, leaving the forum with a topic without any posts.
By asking PostCreator to create the topic instead, inside of its
transaction, this failure condition is eliminated.

Additionally, attachments are restored to working status. Previously,
the attachment code would build up the post raw, but then drop it and
not do anything with the result (creating orphaned uploads). By actually
placing the raw value back in the options hash, it is included in the
created post.
2014-08-28 14:35:43 -07:00
riking 9090df63ba Fix pop3 settings in locale file 2014-08-28 10:45:40 -07:00
riking e28ef099a4 Fix pop3 SSL state leaking over multisite 2014-08-26 17:03:58 -07:00
riking 6d357c9c23 Rename pop3s settings to pop3, remove 'insecure' 2014-08-26 17:03:58 -07:00
riking 5261f2e751 Fix "Server Error: [missing {{code}} value]" page
The translation was expecting a non-existent parameter.
2014-08-25 17:20:48 -07:00
riking 41dadcc349 Fix local onebox subcategory urls 2014-08-25 16:47:54 -07:00
riking 4db5c8d617 Add data-auto-route=true to Logster link 2014-08-25 15:59:48 -07:00
riking 7317c6ed6a Fix tests for new route 2014-08-25 13:07:22 -07:00
riking 234956234b Fix badge type ordering 2014-08-25 12:48:31 -07:00
riking 99c11e2184 Sort the badges on the user profile page
Also clean up UserBadgesController so it isn't doing two things in one
method
2014-08-25 12:40:51 -07:00
riking 2e62cb7825 Add dash and plus signs to Twitter key allowed chars 2014-08-24 17:05:30 -07:00
riking 277b7dc831 Update LazyYT for new onebox version
Much simpler code!
2014-08-22 12:21:02 -07:00
riking 5ae0b9ba42 Remove debugging prints 2014-08-21 17:29:33 -07:00
riking 50d4e283dc Add link to Logster in "Logs" tab of admin panel 2014-08-20 14:40:16 -07:00
riking 903c760a9b Use progress bar indices in jump control, too 2014-08-14 17:52:21 -07:00
riking 8539c08d35 Fix assignment of post number to progress position 2014-08-14 17:31:34 -07:00
riking 62ed597faa Also put the shaded background on desktop 2014-08-13 12:43:27 -07:00
riking 6b22776160 Style & structure fixes for mobile user page 2014-08-13 12:38:55 -07:00
riking b4dc8e7115 Add error reply for new error 2014-08-13 11:47:21 -07:00
riking 90091972b9 Use same reply-to format in all email fixtures 2014-08-13 11:43:49 -07:00
riking cce8b4720a Have reciever handle multiple To addresses 2014-08-13 11:43:49 -07:00
riking 4a75065b62 FIX: Topic progress bar was not updating after expanding gaps 2014-08-01 13:23:53 -07:00
riking de27c6b4b9 Revert bad diff 2014-08-01 12:48:08 -07:00
riking 63cdde3d96 Add more tests, undo some changes to fixture files
Was causing Email::Reciever tests to fail
2014-08-01 12:40:28 -07:00
riking 0faea8ee0b Attempt at checking throws.... 2014-08-01 11:38:44 -07:00
riking c0b2b9b341 Refactor out handle_failure method in PollMailbox 2014-08-01 11:12:06 -07:00
riking d7df4e5979 Start making better-written tests for the email job 2014-08-01 11:03:16 -07:00
riking d87edce6c3 Pass rejection message along in rejection mail if present 2014-08-01 09:56:15 -07:00
riking f9ef715357 Improve email-in category settings UI 2014-07-30 09:58:41 -07:00
riking f80502ea0e Disable logster error reporting during tests 2014-07-28 13:41:45 -07:00
riking 8af4ab2a63 Use settingName in settings_list like the others 2014-07-25 13:19:43 -07:00
riking 5841e10b59 Extra test for spanning italics 2014-07-25 13:15:14 -07:00
riking 400bbb57fe Suppress trackback CSRF errors from Logster 2014-07-25 12:43:57 -07:00
riking 349003ee5e Don't show Try Again for access errors on topics 2014-07-17 17:50:37 -07:00