зеркало из https://github.com/mozilla/pjs.git
Adding Ascii check for mailto url recognition,
bug 201369, r=ben.bucksch, sr=darin.
This commit is contained in:
Родитель
653ae001fd
Коммит
b5293689a8
|
@ -244,6 +244,9 @@ mozTXTToHTMLConv::FindURLStart(const PRUnichar * aInString, PRInt32 aInLength,
|
|||
case abbreviated:
|
||||
{
|
||||
PRInt32 i = pos - 1;
|
||||
// This disallows non-ascii-characters for email.
|
||||
// Currently correct, but revisit later after standards changed.
|
||||
PRBool isEmail = aInString[pos] == (PRUnichar)'@';
|
||||
for (; i >= 0
|
||||
&& aInString[PRUint32(i)] != '>' && aInString[PRUint32(i)] != '<'
|
||||
&& aInString[PRUint32(i)] != '"' && aInString[PRUint32(i)] != '\''
|
||||
|
@ -252,6 +255,7 @@ mozTXTToHTMLConv::FindURLStart(const PRUnichar * aInString, PRInt32 aInLength,
|
|||
&& aInString[PRUint32(i)] != '(' && aInString[PRUint32(i)] != '|'
|
||||
&& aInString[PRUint32(i)] != '\\'
|
||||
&& !IsSpace(aInString[PRUint32(i)])
|
||||
&& (!isEmail || nsCRT::IsAscii(aInString[PRUint32(i)]))
|
||||
; i--)
|
||||
;
|
||||
if
|
||||
|
@ -300,6 +304,9 @@ mozTXTToHTMLConv::FindURLEnd(const PRUnichar * aInString, PRInt32 aInStringLengt
|
|||
case abbreviated:
|
||||
{
|
||||
PRUint32 i = pos + 1;
|
||||
// This disallows non-ascii-characters for email.
|
||||
// Currently correct, but revisit later after standards changed.
|
||||
PRBool isEmail = aInString[pos] == (PRUnichar)'@';
|
||||
for (; PRInt32(i) < aInStringLength
|
||||
&& aInString[i] != '>' && aInString[i] != '<'
|
||||
&& aInString[i] != '"' && aInString[i] != '\''
|
||||
|
@ -307,6 +314,7 @@ mozTXTToHTMLConv::FindURLEnd(const PRUnichar * aInString, PRInt32 aInStringLengt
|
|||
&& aInString[i] != '}' && aInString[i] != ']'
|
||||
&& aInString[i] != ')' && aInString[i] != '|'
|
||||
&& !IsSpace(aInString[i])
|
||||
&& (!isEmail || nsCRT::IsAscii(aInString[i]))
|
||||
; i++)
|
||||
;
|
||||
while (--i > pos && (
|
||||
|
|
Загрузка…
Ссылка в новой задаче