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
1b086834
Commit
1b086834
authored
Apr 12, 2017
by
lain
Browse files
Don't return html in the text field.
parent
b666f11d
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/twitter_api/representers/activity_representer.ex
View file @
1b086834
...
...
@@ -33,7 +33,7 @@ def to_map(%Activity{} = activity, %{user: user} = opts) do
"user"
=>
UserRepresenter
.
to_map
(
user
,
opts
),
"attentions"
=>
[],
"statusnet_html"
=>
content
,
"text"
=>
content
,
"text"
=>
HtmlSanitizeEx
.
strip_tags
(
content
)
,
"is_local"
=>
true
,
"is_post_verb"
=>
true
,
"created_at"
=>
published
,
...
...
test/web/twitter_api/representers/activity_representer_test.exs
View file @
1b086834
...
...
@@ -23,7 +23,8 @@ test "an activity" do
}
}
content
=
"Some content mentioning @shp"
content_html
=
"Some content mentioning <a href='shp'>@shp</shp>"
content
=
HtmlSanitizeEx
.
strip_tags
(
content_html
)
date
=
DateTime
.
utc_now
()
|>
DateTime
.
to_iso8601
activity
=
%
Activity
{
...
...
@@ -39,7 +40,7 @@ test "an activity" do
"object"
=>
%{
"published"
=>
date
,
"type"
=>
"Note"
,
"content"
=>
content
,
"content"
=>
content
_html
,
"inReplyToStatusId"
=>
213123
,
"statusnetConversationId"
=>
4711
,
"attachment"
=>
[
...
...
@@ -56,7 +57,7 @@ test "an activity" do
"user"
=>
UserRepresenter
.
to_map
(
user
,
%{
for:
follower
}),
"is_local"
=>
true
,
"attentions"
=>
[],
"statusnet_html"
=>
content
,
"statusnet_html"
=>
content
_html
,
"text"
=>
content
,
"is_post_verb"
=>
true
,
"created_at"
=>
date
,
...
...
Write
Preview
Markdown
is supported
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