зеркало из https://github.com/mozilla/pjs.git
Fix to escape quotes along with the other special characters - Bug #: 27039 - r: bienvenu
This commit is contained in:
Родитель
09ebc0aef9
Коммит
f9fe1c4033
|
@ -174,7 +174,7 @@ NS_COM PRInt32 nsUnescapeCount(char * str)
|
||||||
NS_COM char *
|
NS_COM char *
|
||||||
nsEscapeHTML(const char * string)
|
nsEscapeHTML(const char * string)
|
||||||
{
|
{
|
||||||
char *rv = (char *) nsAllocator::Alloc(nsCRT::strlen(string)*5 + 1); /* The +1 is for the trailing null! */
|
char *rv = (char *) nsAllocator::Alloc(nsCRT::strlen(string)*6 + 1); /* The +1 is for the trailing null! */
|
||||||
char *ptr = rv;
|
char *ptr = rv;
|
||||||
|
|
||||||
if(rv)
|
if(rv)
|
||||||
|
@ -203,6 +203,15 @@ nsEscapeHTML(const char * string)
|
||||||
*ptr++ = 'p';
|
*ptr++ = 'p';
|
||||||
*ptr++ = ';';
|
*ptr++ = ';';
|
||||||
}
|
}
|
||||||
|
else if (*string == '"')
|
||||||
|
{
|
||||||
|
*ptr++ = '&';
|
||||||
|
*ptr++ = 'q';
|
||||||
|
*ptr++ = 'u';
|
||||||
|
*ptr++ = 'o';
|
||||||
|
*ptr++ = 't';
|
||||||
|
*ptr++ = ';';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*ptr++ = *string;
|
*ptr++ = *string;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче