Fossil

Check-in [e47d862a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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…
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ticket-5ff2043c96
Files: files | file ages | folders
SHA1: e47d862a59c2548747c1c2122be5f5cc2b92ccce
User & Date: jan.nijtmans 2012-11-08 12:04:23
Context
2012-11-08
13:44
Always HTML-encode the href attribute of <a> elements. This check-in simplifies and fixes double-frees in the previous. Ticket [5ff2043c9668] Closed-Leaf check-in: 35bfedef user: drh tags: ticket-5ff2043c96
12:04
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… check-in: e47d862a user: jan.nijtmans tags: ticket-5ff2043c96
09:45
suggested fix for [5ff2043c96] check-in: d1f16f71 user: jan.nijtmans tags: ticket-5ff2043c96
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/style.c.

88
89
90
91
92
93
94

95


96
97
98
99
100
101
102
char *xhref(const char *zExtra, const char *zFormat, ...){
  char *zUrl;
  va_list ap;
  va_start(ap, zFormat);
  zUrl = vmprintf(zFormat, ap);
  va_end(ap);
  if( g.perm.Hyperlink && !g.javascriptHyperlink ){

    return mprintf("<a %s href=\"%z\">", zExtra, zUrl);


  }
  if( nHref>=nHrefAlloc ){
    nHrefAlloc = nHrefAlloc*2 + 10;
    aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
  }
  aHref[nHref++] = zUrl;
  return mprintf("<a %s id=%d>", zExtra, nHref);







>
|
>
>







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
char *xhref(const char *zExtra, const char *zFormat, ...){
  char *zUrl;
  va_list ap;
  va_start(ap, zFormat);
  zUrl = vmprintf(zFormat, ap);
  va_end(ap);
  if( g.perm.Hyperlink && !g.javascriptHyperlink ){
    char *link = htmlize(zUrl, strlen(zUrl));
    zUrl = mprintf("<a %s href=\"%z\">", zExtra, link);
    fossil_free(link);
    return zUrl;
  }
  if( nHref>=nHrefAlloc ){
    nHrefAlloc = nHrefAlloc*2 + 10;
    aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
  }
  aHref[nHref++] = zUrl;
  return mprintf("<a %s id=%d>", zExtra, nHref);