Commit 7a073990 authored by baire's avatar baire
Browse files

factorised the character ranges used in userinfo

parent 21df0484
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -47,11 +47,16 @@ private:
	regmatch_t	mMatches[16];
};

#define SIPCHARS_MARK		"\\-_.!~*'()"
#define SIPCHARS_UNRESERVED	"A-Za-z0-9" SIPCHARS_MARK
#define SIPCHARS_USER_UNRESERVED "&=+$,;?/"
#define SIPCHARS_ESCAPED	"%0-9"

void SipUrl::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{

	static Regex reg_scheme ("^sip:", REG_ICASE);
	static Regex reg_userinfo ("^[&=+$,;?/A-Z0-9\\-_.!~*'():]*@", REG_ICASE);
	static Regex reg_userinfo ("^[:" SIPCHARS_UNRESERVED SIPCHARS_USER_UNRESERVED SIPCHARS_ESCAPED  "]*@", REG_ICASE);

	switch (id) {
	case id_scheme: