Fossil SCM
Be careful to honor the auto-hyperlinks setting when it is off, and not display any hyperlinks. See [forum:5a7530639a|forum post 5a7530639a] for the bug report.
Commit
b190858e97d3f31b6a825e2bf44d3bd03373624cd21562e0c08bc2de30cd6940
Parent
7221e497fc951a3…
1 file changed
+5
-2
+5
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -140,10 +140,11 @@ | ||
| 140 | 140 | ** typically. |
| 141 | 141 | */ |
| 142 | 142 | char *xhref(const char *zExtra, const char *zFormat, ...){ |
| 143 | 143 | char *zUrl; |
| 144 | 144 | va_list ap; |
| 145 | + if( !g.perm.Hyperlink ) return fossil_strdup(""); | |
| 145 | 146 | va_start(ap, zFormat); |
| 146 | 147 | zUrl = vmprintf(zFormat, ap); |
| 147 | 148 | va_end(ap); |
| 148 | 149 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 149 | 150 | char *zHUrl; |
| @@ -164,10 +165,11 @@ | ||
| 164 | 165 | } |
| 165 | 166 | } |
| 166 | 167 | char *chref(const char *zExtra, const char *zFormat, ...){ |
| 167 | 168 | char *zUrl; |
| 168 | 169 | va_list ap; |
| 170 | + if( !g.perm.Hyperlink ) return fossil_strdup(""); | |
| 169 | 171 | va_start(ap, zFormat); |
| 170 | 172 | zUrl = vmprintf(zFormat, ap); |
| 171 | 173 | va_end(ap); |
| 172 | 174 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 173 | 175 | char *zHUrl = mprintf("<a class=\"%s\" href=\"%h\">", zExtra, zUrl); |
| @@ -179,10 +181,11 @@ | ||
| 179 | 181 | zExtra, zUrl); |
| 180 | 182 | } |
| 181 | 183 | char *href(const char *zFormat, ...){ |
| 182 | 184 | char *zUrl; |
| 183 | 185 | va_list ap; |
| 186 | + if( !g.perm.Hyperlink ) return fossil_strdup(""); | |
| 184 | 187 | va_start(ap, zFormat); |
| 185 | 188 | zUrl = vmprintf(zFormat, ap); |
| 186 | 189 | va_end(ap); |
| 187 | 190 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 188 | 191 | char *zHUrl = mprintf("<a href=\"%h\">", zUrl); |
| @@ -708,11 +711,11 @@ | ||
| 708 | 711 | |
| 709 | 712 | /* |
| 710 | 713 | ** Generate code to load all required javascript files. |
| 711 | 714 | */ |
| 712 | 715 | static void style_load_all_js_files(void){ |
| 713 | - if( needHrefJs ){ | |
| 716 | + if( needHrefJs && g.perm.Hyperlink ){ | |
| 714 | 717 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 715 | 718 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0); |
| 716 | 719 | @ <script id='href-data' type='application/json'>\ |
| 717 | 720 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 718 | 721 | } |
| @@ -719,11 +722,11 @@ | ||
| 719 | 722 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 720 | 723 | @ function debugMsg(msg){ |
| 721 | 724 | @ var n = document.getElementById("debugMsg"); |
| 722 | 725 | @ if(n){n.textContent=msg;} |
| 723 | 726 | @ } |
| 724 | - if( needHrefJs ){ | |
| 727 | + if( needHrefJs && g.perm.Hyperlink ){ | |
| 725 | 728 | @ /* href.js */ |
| 726 | 729 | cgi_append_content(builtin_text("href.js"),-1); |
| 727 | 730 | } |
| 728 | 731 | if( blob_size(&blobOnLoad)>0 ){ |
| 729 | 732 | @ window.onload = function(){ |
| 730 | 733 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -140,10 +140,11 @@ | |
| 140 | ** typically. |
| 141 | */ |
| 142 | char *xhref(const char *zExtra, const char *zFormat, ...){ |
| 143 | char *zUrl; |
| 144 | va_list ap; |
| 145 | va_start(ap, zFormat); |
| 146 | zUrl = vmprintf(zFormat, ap); |
| 147 | va_end(ap); |
| 148 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 149 | char *zHUrl; |
| @@ -164,10 +165,11 @@ | |
| 164 | } |
| 165 | } |
| 166 | char *chref(const char *zExtra, const char *zFormat, ...){ |
| 167 | char *zUrl; |
| 168 | va_list ap; |
| 169 | va_start(ap, zFormat); |
| 170 | zUrl = vmprintf(zFormat, ap); |
| 171 | va_end(ap); |
| 172 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 173 | char *zHUrl = mprintf("<a class=\"%s\" href=\"%h\">", zExtra, zUrl); |
| @@ -179,10 +181,11 @@ | |
| 179 | zExtra, zUrl); |
| 180 | } |
| 181 | char *href(const char *zFormat, ...){ |
| 182 | char *zUrl; |
| 183 | va_list ap; |
| 184 | va_start(ap, zFormat); |
| 185 | zUrl = vmprintf(zFormat, ap); |
| 186 | va_end(ap); |
| 187 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 188 | char *zHUrl = mprintf("<a href=\"%h\">", zUrl); |
| @@ -708,11 +711,11 @@ | |
| 708 | |
| 709 | /* |
| 710 | ** Generate code to load all required javascript files. |
| 711 | */ |
| 712 | static void style_load_all_js_files(void){ |
| 713 | if( needHrefJs ){ |
| 714 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 715 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0); |
| 716 | @ <script id='href-data' type='application/json'>\ |
| 717 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 718 | } |
| @@ -719,11 +722,11 @@ | |
| 719 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 720 | @ function debugMsg(msg){ |
| 721 | @ var n = document.getElementById("debugMsg"); |
| 722 | @ if(n){n.textContent=msg;} |
| 723 | @ } |
| 724 | if( needHrefJs ){ |
| 725 | @ /* href.js */ |
| 726 | cgi_append_content(builtin_text("href.js"),-1); |
| 727 | } |
| 728 | if( blob_size(&blobOnLoad)>0 ){ |
| 729 | @ window.onload = function(){ |
| 730 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -140,10 +140,11 @@ | |
| 140 | ** typically. |
| 141 | */ |
| 142 | char *xhref(const char *zExtra, const char *zFormat, ...){ |
| 143 | char *zUrl; |
| 144 | va_list ap; |
| 145 | if( !g.perm.Hyperlink ) return fossil_strdup(""); |
| 146 | va_start(ap, zFormat); |
| 147 | zUrl = vmprintf(zFormat, ap); |
| 148 | va_end(ap); |
| 149 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 150 | char *zHUrl; |
| @@ -164,10 +165,11 @@ | |
| 165 | } |
| 166 | } |
| 167 | char *chref(const char *zExtra, const char *zFormat, ...){ |
| 168 | char *zUrl; |
| 169 | va_list ap; |
| 170 | if( !g.perm.Hyperlink ) return fossil_strdup(""); |
| 171 | va_start(ap, zFormat); |
| 172 | zUrl = vmprintf(zFormat, ap); |
| 173 | va_end(ap); |
| 174 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 175 | char *zHUrl = mprintf("<a class=\"%s\" href=\"%h\">", zExtra, zUrl); |
| @@ -179,10 +181,11 @@ | |
| 181 | zExtra, zUrl); |
| 182 | } |
| 183 | char *href(const char *zFormat, ...){ |
| 184 | char *zUrl; |
| 185 | va_list ap; |
| 186 | if( !g.perm.Hyperlink ) return fossil_strdup(""); |
| 187 | va_start(ap, zFormat); |
| 188 | zUrl = vmprintf(zFormat, ap); |
| 189 | va_end(ap); |
| 190 | if( g.perm.Hyperlink && !g.javascriptHyperlink ){ |
| 191 | char *zHUrl = mprintf("<a href=\"%h\">", zUrl); |
| @@ -708,11 +711,11 @@ | |
| 711 | |
| 712 | /* |
| 713 | ** Generate code to load all required javascript files. |
| 714 | */ |
| 715 | static void style_load_all_js_files(void){ |
| 716 | if( needHrefJs && g.perm.Hyperlink ){ |
| 717 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 718 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0); |
| 719 | @ <script id='href-data' type='application/json'>\ |
| 720 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 721 | } |
| @@ -719,11 +722,11 @@ | |
| 722 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 723 | @ function debugMsg(msg){ |
| 724 | @ var n = document.getElementById("debugMsg"); |
| 725 | @ if(n){n.textContent=msg;} |
| 726 | @ } |
| 727 | if( needHrefJs && g.perm.Hyperlink ){ |
| 728 | @ /* href.js */ |
| 729 | cgi_append_content(builtin_text("href.js"),-1); |
| 730 | } |
| 731 | if( blob_size(&blobOnLoad)>0 ){ |
| 732 | @ window.onload = function(){ |
| 733 |