Skip to content

Commit

Permalink
[core] Add platform.twitter.com to whitelist (#1647)
Browse files Browse the repository at this point in the history
Currently the javascript of a tweet embed is removed.
See issue: #1646
(cherry picked from commit 8372e22)
  • Loading branch information
loetie authored and ddeboer committed Mar 30, 2017
1 parent ea2a94a commit 3680397
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/support/z_sanitize.erl
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ preferred_protocol(<<"www.youtube.", _/binary>>) -> <<>>;
preferred_protocol(<<"vimeo.", _/binary>>) -> <<>>;
preferred_protocol(<<"www.vimeo.", _/binary>>) -> <<>>;
preferred_protocol(<<"platform.instagram.com", _/binary>>) -> <<>>;
preferred_protocol(<<"platform.twitter.com", _/binary>>) -> <<>>;
preferred_protocol(<<"www.flickr.", _/binary>>) -> <<"https:">>;
preferred_protocol(_) -> undefined.

Expand Down Expand Up @@ -352,6 +353,7 @@ wl(<<"www.tumblr.com/", _/binary>> = Url) -> {ok, Url};
wl(<<"assets.tumblr.com/", _/binary>> = Url) -> {ok, Url};
wl(<<"static.issuu.com/", _/binary>> = Url) -> {ok, Url};
wl(<<"e.issuu.com/", _/binary>> = Url) -> {ok, Url};
wl(<<"platform.twitter.com/", _/binary>> = Url) -> {ok, Url};
wl(Url) ->
case lists:dropwhile(fun(Re) ->
re:run(Url, Re) =:= nomatch
Expand Down

0 comments on commit 3680397

Please sign in to comment.