diff options
author | Alex S <alex.strizhakov@gmail.com> | 2019-05-01 12:29:33 +0700 |
---|---|---|
committer | Alex S <alex.strizhakov@gmail.com> | 2019-05-01 12:29:33 +0700 |
commit | bdfa3a6fa87f95e93aa853ec4961645215f31221 (patch) | |
tree | 467b9dd762c9878541e34f2b38a1c58e387c8f2c /lib/pleroma/web/controller_helper.ex | |
parent | 97b35e00b049c8f908484163b5ffdbcb55db7867 (diff) | |
parent | 77690b9d03facf74483e3379f72b5b51c9f1bd4e (diff) | |
download | pleroma-bdfa3a6fa87f95e93aa853ec4961645215f31221.tar.gz |
Merging with develop
Conflicts:
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/user.ex
Diffstat (limited to 'lib/pleroma/web/controller_helper.ex')
-rw-r--r-- | lib/pleroma/web/controller_helper.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 4d6192db0..181483664 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -5,6 +5,11 @@ defmodule Pleroma.Web.ControllerHelper do use Pleroma.Web, :controller + # As in MastoAPI, per https://api.rubyonrails.org/classes/ActiveModel/Type/Boolean.html + @falsy_param_values [false, 0, "0", "f", "F", "false", "FALSE", "off", "OFF"] + def truthy_param?(blank_value) when blank_value in [nil, ""], do: nil + def truthy_param?(value), do: value not in @falsy_param_values + def oauth_scopes(params, default) do # Note: `scopes` is used by Mastodon — supporting it but sticking to # OAuth's standard `scope` wherever we control it |