Fossil SCM
one more similar fix, in xhref(). There is only one hyperlink using xhref with ampersands, in the "vinfo" and "ci" pages, but just for completeness…
Commit
e47d862a59c2548747c1c2122be5f5cc2b92ccce
Parent
d1f16f718ab7489…
1 file changed
+4
-1
+4
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -90,11 +90,14 @@ | ||
| 90 | 90 | va_list ap; |
| 91 | 91 | va_start(ap, zFormat); |
| 92 | 92 | zUrl = vmprintf(zFormat, ap); |
| 93 | 93 | va_end(ap); |
| 94 | 94 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 95 | - return mprintf("<a %s href=\"%z\">", zExtra, zUrl); | |
| 95 | + char *link = htmlize(zUrl, strlen(zUrl)); | |
| 96 | + zUrl = mprintf("<a %s href=\"%z\">", zExtra, link); | |
| 97 | + fossil_free(link); | |
| 98 | + return zUrl; | |
| 96 | 99 | } |
| 97 | 100 | if( nHref>=nHrefAlloc ){ |
| 98 | 101 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 99 | 102 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 100 | 103 | } |
| 101 | 104 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -90,11 +90,14 @@ | |
| 90 | va_list ap; |
| 91 | va_start(ap, zFormat); |
| 92 | zUrl = vmprintf(zFormat, ap); |
| 93 | va_end(ap); |
| 94 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 95 | return mprintf("<a %s href=\"%z\">", zExtra, zUrl); |
| 96 | } |
| 97 | if( nHref>=nHrefAlloc ){ |
| 98 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 99 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 100 | } |
| 101 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -90,11 +90,14 @@ | |
| 90 | va_list ap; |
| 91 | va_start(ap, zFormat); |
| 92 | zUrl = vmprintf(zFormat, ap); |
| 93 | va_end(ap); |
| 94 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 95 | char *link = htmlize(zUrl, strlen(zUrl)); |
| 96 | zUrl = mprintf("<a %s href=\"%z\">", zExtra, link); |
| 97 | fossil_free(link); |
| 98 | return zUrl; |
| 99 | } |
| 100 | if( nHref>=nHrefAlloc ){ |
| 101 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 102 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 103 | } |
| 104 |