mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-21 12:47:58 +00:00
0a120d86d2
* Fix error-prone SQL queries in Account search While this code seems to not present an actual vulnerability, one could easily be introduced by mistake due to how the query is built. This PR parameterises the `to_tsquery` input to make the query more robust. * Harden code for Status#tagged_with_all and Status#tagged_with_none Those two scopes aren't used in a way that could be vulnerable to an SQL injection, but keeping them unchanged might be a hazard. * Remove unneeded spaces surrounding tsquery term * Please CodeClimate * Move advanced_search_for SQL template to its own function This avoids one level of indentation while making clearer that the SQL template isn't build from all the dynamic parameters of advanced_search_for. * Add tests covering tagged_with, tagged_with_all and tagged_with_none * Rewrite tagged_with_none to avoid multiple joins and make it more robust * Remove obsolete brakeman warnings * Revert "Remove unneeded spaces surrounding tsquery term" The two queries are not strictly equivalent. This reverts commit 86f16c537e06c6ba4a8b250f25dcce9f049023ff. |
||
---|---|---|
.. | ||
admin | ||
concerns | ||
trends | ||
web | ||
account_alias_spec.rb | ||
account_conversation_spec.rb | ||
account_deletion_request_spec.rb | ||
account_domain_block_spec.rb | ||
account_filter_spec.rb | ||
account_migration_spec.rb | ||
account_moderation_note_spec.rb | ||
account_spec.rb | ||
account_statuses_cleanup_policy_spec.rb | ||
announcement_mute_spec.rb | ||
announcement_reaction_spec.rb | ||
announcement_spec.rb | ||
backup_spec.rb | ||
block_spec.rb | ||
canonical_email_block_spec.rb | ||
conversation_mute_spec.rb | ||
conversation_spec.rb | ||
custom_emoji_category_spec.rb | ||
custom_emoji_filter_spec.rb | ||
custom_emoji_spec.rb | ||
custom_filter_spec.rb | ||
device_spec.rb | ||
domain_allow_spec.rb | ||
domain_block_spec.rb | ||
email_domain_block_spec.rb | ||
encrypted_message_spec.rb | ||
export_spec.rb | ||
favourite_spec.rb | ||
featured_tag_spec.rb | ||
follow_recommendation_suppression_spec.rb | ||
follow_request_spec.rb | ||
follow_spec.rb | ||
home_feed_spec.rb | ||
identity_spec.rb | ||
import_spec.rb | ||
invite_spec.rb | ||
ip_block_spec.rb | ||
list_account_spec.rb | ||
list_spec.rb | ||
login_activity_spec.rb | ||
marker_spec.rb | ||
media_attachment_spec.rb | ||
mention_spec.rb | ||
mute_spec.rb | ||
notification_spec.rb | ||
one_time_key_spec.rb | ||
poll_spec.rb | ||
poll_vote_spec.rb | ||
preview_card_spec.rb | ||
public_feed_spec.rb | ||
relationship_filter_spec.rb | ||
relay_spec.rb | ||
remote_follow_spec.rb | ||
report_filter_spec.rb | ||
report_spec.rb | ||
rule_spec.rb | ||
scheduled_status_spec.rb | ||
session_activation_spec.rb | ||
setting_spec.rb | ||
site_upload_spec.rb | ||
status_edit_spec.rb | ||
status_pin_spec.rb | ||
status_spec.rb | ||
status_stat_spec.rb | ||
system_key_spec.rb | ||
tag_feed_spec.rb | ||
tag_spec.rb | ||
unavailable_domain_spec.rb | ||
user_invite_request_spec.rb | ||
user_spec.rb | ||
webauthn_credentials_spec.rb |