Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
0787f0df
Commit
0787f0df
authored
Jan 05, 2019
by
scarlett
Browse files
Strip HTML in and allow emoji in summaries.
parent
eaaf7013
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/common_api/common_api.ex
View file @
0787f0df
...
...
@@ -124,7 +124,7 @@ def post(user, %{"status" => status} = data) do
Map
.
put
(
object
,
"emoji"
,
Formatter
.
get_emoji
(
status
)
Formatter
.
get_emoji
(
status
)
++
Formatter
.
get_emoji
(
data
[
"spoiler_text"
])
|>
Enum
.
reduce
(%{},
fn
{
name
,
file
},
acc
->
Map
.
put
(
acc
,
name
,
"
#{
Pleroma
.
Web
.
Endpoint
.
static_url
()
}#{
file
}
"
)
end
)
...
...
lib/pleroma/web/twitter_api/views/activity_view.ex
View file @
0787f0df
...
...
@@ -285,7 +285,7 @@ def render(
"activity_type"
=>
"post"
,
"possibly_sensitive"
=>
possibly_sensitive
,
"visibility"
=>
Pleroma
.
Web
.
MastodonAPI
.
StatusView
.
get_visibility
(
object
),
"summary"
=>
summary
"summary"
=>
HTML
.
strip_tags
(
summary
)
|>
Formatter
.
emojify
(
object
[
"emoji"
])
}
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment