]> granicus.if.org Git - ejabberd/commitdiff
Validate BINVAL values of vcard elements as Base64
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 2 Aug 2019 11:20:10 +0000 (14:20 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Fri, 2 Aug 2019 11:20:10 +0000 (14:20 +0300)
rebar.config
src/econf.erl

index b3675422527cee92a94ecbbb5fe17c5e7a1c16ce..dd4972031bd7613fcf8875a2a441ea3253823646 100644 (file)
@@ -26,7 +26,7 @@
         {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", "7fd02f3a2f"}},
         {xmpp, ".*", {git, "https://github.com/processone/xmpp", "d2b3c3c"}},
         {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.19"}}},
-       {yconf, ".*", {git, "https://github.com/processone/yconf", "4bdf771"}},
+       {yconf, ".*", {git, "https://github.com/processone/yconf", "97a1189"}},
         {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}},
         {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.5"}}},
         {pkix, ".*", {git, "https://github.com/processone/pkix", "2d7a3b8"}},
index 4b7ccd587313c9c06e8f855c5dd77e3fa01c2cb0..bfa9cd78141daa5152454a7d07f9664dbdb670b3 100644 (file)
@@ -37,7 +37,7 @@
 -export([ip/0, ipv4/0, ipv6/0, ip_mask/0, port/0]).
 -export([re/0, re/1, glob/0, glob/1]).
 -export([path/0, binary_sep/1]).
--export([beam/0, beam/1]).
+-export([beam/0, beam/1, base64/0]).
 -export([timeout/1, timeout/2]).
 %% Composite types
 -export([list/1, list/2]).
@@ -338,6 +338,9 @@ timeout(Units) ->
 timeout(Units, Inf) ->
     yconf:timeout(Units, Inf).
 
+base64() ->
+    yconf:base64().
+
 non_empty(F) ->
     yconf:non_empty(F).
 
@@ -576,7 +579,7 @@ vcard_photo() ->
     vcard_validator(
       vcard_photo, undefined,
       [{type, undefined, binary()},
-       {binval, undefined, binary()},
+       {binval, undefined, base64()},
        {extval, undefined, binary()}]).
 
 -spec vcard_adr() -> yconf:validator().
@@ -653,7 +656,7 @@ vcard_logo() ->
     vcard_validator(
       vcard_logo, undefined,
       [{type, undefined, binary()},
-       {binval, undefined, binary()},
+       {binval, undefined, base64()},
        {extval, undefined, binary()}]).
 
 -spec vcard_org() -> yconf:validator().
@@ -668,7 +671,7 @@ vcard_sound() ->
     vcard_validator(
       vcard_sound, undefined,
       [{phonetic, undefined, binary()},
-       {binval, undefined, binary()},
+       {binval, undefined, base64()},
        {extval, undefined, binary()}]).
 
 -spec vcard_key() -> yconv:validator().