Fossil SCM

Add <base href="$baseurl/"> to the html header in the default configuration and in all built-in skins. Add a warning if <base> is not configured. Generate hyperlinks from wiki relative to the <base>

drh 2012-08-11 13:58 UTC wysiwyg
Commit 31732d77ff6c661a14f548db5c036639cf37084f
+8
--- src/cgi.c
+++ src/cgi.c
@@ -95,10 +95,18 @@
9595
default: {
9696
cgi_panic("bad destination");
9797
}
9898
}
9999
}
100
+
101
+/*
102
+** Check to see if the header contains the zNeedle string. Return true
103
+** if it does and false if it does not.
104
+*/
105
+int cgi_header_contains(const char *zNeedle){
106
+ return strstr(blob_str(&cgiContent[0]), zNeedle)!=0;
107
+}
100108
101109
/*
102110
** Append reply content to what already exists.
103111
*/
104112
void cgi_append_content(const char *zData, int nAmt){
105113
--- src/cgi.c
+++ src/cgi.c
@@ -95,10 +95,18 @@
95 default: {
96 cgi_panic("bad destination");
97 }
98 }
99 }
 
 
 
 
 
 
 
 
100
101 /*
102 ** Append reply content to what already exists.
103 */
104 void cgi_append_content(const char *zData, int nAmt){
105
--- src/cgi.c
+++ src/cgi.c
@@ -95,10 +95,18 @@
95 default: {
96 cgi_panic("bad destination");
97 }
98 }
99 }
100
101 /*
102 ** Check to see if the header contains the zNeedle string. Return true
103 ** if it does and false if it does not.
104 */
105 int cgi_header_contains(const char *zNeedle){
106 return strstr(blob_str(&cgiContent[0]), zNeedle)!=0;
107 }
108
109 /*
110 ** Append reply content to what already exists.
111 */
112 void cgi_append_content(const char *zData, int nAmt){
113
--- src/setup.c
+++ src/setup.c
@@ -57,10 +57,19 @@
5757
if( !g.perm.Setup ){
5858
login_needed();
5959
}
6060
6161
style_header("Server Administration");
62
+
63
+ /* Make sure the header contains <base href="...">. Issue a warning
64
+ ** if it does not. */
65
+ if( !cgi_header_contains("<base href=") ){
66
+ @ <p class="generalError"><b>Configuration Error:</b> Please add
67
+ @ <tt>&lt;base href="$baseurl/" /&gt</tt> after <tt>&lt;head&gt;</tt>
68
+ @ in the <a href="setup_header">HTML header</a>!</p>
69
+ }
70
+
6271
@ <table border="0" cellspacing="7">
6372
setup_menu_entry("Users", "setup_ulist",
6473
"Grant privileges to individual users.");
6574
setup_menu_entry("Access", "setup_access",
6675
"Control access settings.");
6776
--- src/setup.c
+++ src/setup.c
@@ -57,10 +57,19 @@
57 if( !g.perm.Setup ){
58 login_needed();
59 }
60
61 style_header("Server Administration");
 
 
 
 
 
 
 
 
 
62 @ <table border="0" cellspacing="7">
63 setup_menu_entry("Users", "setup_ulist",
64 "Grant privileges to individual users.");
65 setup_menu_entry("Access", "setup_access",
66 "Control access settings.");
67
--- src/setup.c
+++ src/setup.c
@@ -57,10 +57,19 @@
57 if( !g.perm.Setup ){
58 login_needed();
59 }
60
61 style_header("Server Administration");
62
63 /* Make sure the header contains <base href="...">. Issue a warning
64 ** if it does not. */
65 if( !cgi_header_contains("<base href=") ){
66 @ <p class="generalError"><b>Configuration Error:</b> Please add
67 @ <tt>&lt;base href="$baseurl/" /&gt</tt> after <tt>&lt;head&gt;</tt>
68 @ in the <a href="setup_header">HTML header</a>!</p>
69 }
70
71 @ <table border="0" cellspacing="7">
72 setup_menu_entry("Users", "setup_ulist",
73 "Grant privileges to individual users.");
74 setup_menu_entry("Access", "setup_access",
75 "Control access settings.");
76
--- src/skins.c
+++ src/skins.c
@@ -156,10 +156,11 @@
156156
@ text-align: right;
157157
@ padding: 0.2ex 2ex;
158158
@ }');
159159
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
160160
@ <head>
161
+@ <base href="$baseurl/" />
161162
@ <title>$<project_name>: $<title></title>
162163
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
163164
@ href="$home/timeline.rss">
164165
@ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css"
165166
@ media="screen">
@@ -358,10 +359,11 @@
358359
@ text-align: right;
359360
@ padding: 0.2ex 2ex;
360361
@ }');
361362
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
362363
@ <head>
364
+@ <base href="$baseurl/" />
363365
@ <title>$<project_name>: $<title></title>
364366
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
365367
@ href="$home/timeline.rss">
366368
@ <link rel="stylesheet" href="$home/style.css?tan" type="text/css"
367369
@ media="screen">
@@ -594,10 +596,11 @@
594596
@ text-align: right;
595597
@ padding: 0.2ex 2ex;
596598
@ }');
597599
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
598600
@ <head>
601
+@ <base href="$baseurl/" />
599602
@ <title>$<project_name>: $<title></title>
600603
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
601604
@ href="$home/timeline.rss">
602605
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
603606
@ media="screen">
@@ -892,10 +895,11 @@
892895
@ textarea {
893896
@ font-size: 1em;
894897
@ }');
895898
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
896899
@ <head>
900
+@ <base href="$baseurl/" />
897901
@ <title>$<project_name>: $<title></title>
898902
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
899903
@ href="$home/timeline.rss">
900904
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
901905
@ media="screen">
902906
--- src/skins.c
+++ src/skins.c
@@ -156,10 +156,11 @@
156 @ text-align: right;
157 @ padding: 0.2ex 2ex;
158 @ }');
159 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
160 @ <head>
 
161 @ <title>$<project_name>: $<title></title>
162 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
163 @ href="$home/timeline.rss">
164 @ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css"
165 @ media="screen">
@@ -358,10 +359,11 @@
358 @ text-align: right;
359 @ padding: 0.2ex 2ex;
360 @ }');
361 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
362 @ <head>
 
363 @ <title>$<project_name>: $<title></title>
364 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
365 @ href="$home/timeline.rss">
366 @ <link rel="stylesheet" href="$home/style.css?tan" type="text/css"
367 @ media="screen">
@@ -594,10 +596,11 @@
594 @ text-align: right;
595 @ padding: 0.2ex 2ex;
596 @ }');
597 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
598 @ <head>
 
599 @ <title>$<project_name>: $<title></title>
600 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
601 @ href="$home/timeline.rss">
602 @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
603 @ media="screen">
@@ -892,10 +895,11 @@
892 @ textarea {
893 @ font-size: 1em;
894 @ }');
895 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
896 @ <head>
 
897 @ <title>$<project_name>: $<title></title>
898 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
899 @ href="$home/timeline.rss">
900 @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
901 @ media="screen">
902
--- src/skins.c
+++ src/skins.c
@@ -156,10 +156,11 @@
156 @ text-align: right;
157 @ padding: 0.2ex 2ex;
158 @ }');
159 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
160 @ <head>
161 @ <base href="$baseurl/" />
162 @ <title>$<project_name>: $<title></title>
163 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
164 @ href="$home/timeline.rss">
165 @ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css"
166 @ media="screen">
@@ -358,10 +359,11 @@
359 @ text-align: right;
360 @ padding: 0.2ex 2ex;
361 @ }');
362 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
363 @ <head>
364 @ <base href="$baseurl/" />
365 @ <title>$<project_name>: $<title></title>
366 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
367 @ href="$home/timeline.rss">
368 @ <link rel="stylesheet" href="$home/style.css?tan" type="text/css"
369 @ media="screen">
@@ -594,10 +596,11 @@
596 @ text-align: right;
597 @ padding: 0.2ex 2ex;
598 @ }');
599 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
600 @ <head>
601 @ <base href="$baseurl/" />
602 @ <title>$<project_name>: $<title></title>
603 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
604 @ href="$home/timeline.rss">
605 @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
606 @ media="screen">
@@ -892,10 +895,11 @@
895 @ textarea {
896 @ font-size: 1em;
897 @ }');
898 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
899 @ <head>
900 @ <base href="$baseurl/" />
901 @ <title>$<project_name>: $<title></title>
902 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
903 @ href="$home/timeline.rss">
904 @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
905 @ media="screen">
906
+13 -11
--- src/style.c
+++ src/style.c
@@ -203,11 +203,12 @@
203203
g.cgiOutput = 1;
204204
headerHasBeenGenerated = 1;
205205
sideboxUsed = 0;
206206
207207
/* Make the gebi(x) function available as an almost-alias for
208
- ** document.getElementById(x) (except that it throws if the element is not found).
208
+ ** document.getElementById(x) (except that it throws an error
209
+ ** if the element is not found).
209210
**
210211
** Maintenance note: this function must of course be available
211212
** before it is called. It "should" go in the HEAD so that client
212213
** HEAD code can make use of it, but because the client can replace
213214
** the HEAD, and some fossil pages rely on gebi(), we put it here.
@@ -316,10 +317,11 @@
316317
** The default page header.
317318
*/
318319
const char zDefaultHeader[] =
319320
@ <html>
320321
@ <head>
322
+@ <base href="$baseurl/">
321323
@ <title>$<project_name>: $<title></title>
322324
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
323325
@ href="$home/timeline.rss" />
324326
@ <link rel="stylesheet" href="$home/style.css?default" type="text/css"
325327
@ media="screen" />
@@ -340,34 +342,34 @@
340342
@ </div>
341343
@ <div class="mainmenu">
342344
@ <th1>
343345
@ html "<a href='$home$index_page'>Home</a>\n"
344346
@ if {[anycap jor]} {
345
-@ html "<a href='$home/timeline'>Timeline</a>\n"
347
+@ html "<a href='timeline'>Timeline</a>\n"
346348
@ }
347349
@ if {[hascap oh]} {
348
-@ html "<a href='$home/dir?ci=tip'>Files</a>\n"
350
+@ html "<a href='dir?ci=tip'>Files</a>\n"
349351
@ }
350352
@ if {[hascap o]} {
351
-@ html "<a href='$home/brlist'>Branches</a>\n"
352
-@ html "<a href='$home/taglist'>Tags</a>\n"
353
+@ html "<a href='brlist'>Branches</a>\n"
354
+@ html "<a href='taglist'>Tags</a>\n"
353355
@ }
354356
@ if {[hascap r]} {
355
-@ html "<a href='$home/reportlist'>Tickets</a>\n"
357
+@ html "<a href='reportlist'>Tickets</a>\n"
356358
@ }
357359
@ if {[hascap j]} {
358
-@ html "<a href='$home/wiki'>Wiki</a>\n"
360
+@ html "<a href='wiki'>Wiki</a>\n"
359361
@ }
360362
@ if {[hascap s]} {
361
-@ html "<a href='$home/setup'>Admin</a>\n"
363
+@ html "<a href='setup'>Admin</a>\n"
362364
@ } elseif {[hascap a]} {
363
-@ html "<a href='$home/setup_ulist'>Users</a>\n"
365
+@ html "<a href='setup_ulist'>Users</a>\n"
364366
@ }
365367
@ if {[info exists login]} {
366
-@ html "<a href='$home/login'>Logout</a>\n"
368
+@ html "<a href='login'>Logout</a>\n"
367369
@ } else {
368
-@ html "<a href='$home/login'>Login</a>\n"
370
+@ html "<a href='login'>Login</a>\n"
369371
@ }
370372
@ </th1></div>
371373
;
372374
373375
/*
374376
--- src/style.c
+++ src/style.c
@@ -203,11 +203,12 @@
203 g.cgiOutput = 1;
204 headerHasBeenGenerated = 1;
205 sideboxUsed = 0;
206
207 /* Make the gebi(x) function available as an almost-alias for
208 ** document.getElementById(x) (except that it throws if the element is not found).
 
209 **
210 ** Maintenance note: this function must of course be available
211 ** before it is called. It "should" go in the HEAD so that client
212 ** HEAD code can make use of it, but because the client can replace
213 ** the HEAD, and some fossil pages rely on gebi(), we put it here.
@@ -316,10 +317,11 @@
316 ** The default page header.
317 */
318 const char zDefaultHeader[] =
319 @ <html>
320 @ <head>
 
321 @ <title>$<project_name>: $<title></title>
322 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
323 @ href="$home/timeline.rss" />
324 @ <link rel="stylesheet" href="$home/style.css?default" type="text/css"
325 @ media="screen" />
@@ -340,34 +342,34 @@
340 @ </div>
341 @ <div class="mainmenu">
342 @ <th1>
343 @ html "<a href='$home$index_page'>Home</a>\n"
344 @ if {[anycap jor]} {
345 @ html "<a href='$home/timeline'>Timeline</a>\n"
346 @ }
347 @ if {[hascap oh]} {
348 @ html "<a href='$home/dir?ci=tip'>Files</a>\n"
349 @ }
350 @ if {[hascap o]} {
351 @ html "<a href='$home/brlist'>Branches</a>\n"
352 @ html "<a href='$home/taglist'>Tags</a>\n"
353 @ }
354 @ if {[hascap r]} {
355 @ html "<a href='$home/reportlist'>Tickets</a>\n"
356 @ }
357 @ if {[hascap j]} {
358 @ html "<a href='$home/wiki'>Wiki</a>\n"
359 @ }
360 @ if {[hascap s]} {
361 @ html "<a href='$home/setup'>Admin</a>\n"
362 @ } elseif {[hascap a]} {
363 @ html "<a href='$home/setup_ulist'>Users</a>\n"
364 @ }
365 @ if {[info exists login]} {
366 @ html "<a href='$home/login'>Logout</a>\n"
367 @ } else {
368 @ html "<a href='$home/login'>Login</a>\n"
369 @ }
370 @ </th1></div>
371 ;
372
373 /*
374
--- src/style.c
+++ src/style.c
@@ -203,11 +203,12 @@
203 g.cgiOutput = 1;
204 headerHasBeenGenerated = 1;
205 sideboxUsed = 0;
206
207 /* Make the gebi(x) function available as an almost-alias for
208 ** document.getElementById(x) (except that it throws an error
209 ** if the element is not found).
210 **
211 ** Maintenance note: this function must of course be available
212 ** before it is called. It "should" go in the HEAD so that client
213 ** HEAD code can make use of it, but because the client can replace
214 ** the HEAD, and some fossil pages rely on gebi(), we put it here.
@@ -316,10 +317,11 @@
317 ** The default page header.
318 */
319 const char zDefaultHeader[] =
320 @ <html>
321 @ <head>
322 @ <base href="$baseurl/">
323 @ <title>$<project_name>: $<title></title>
324 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
325 @ href="$home/timeline.rss" />
326 @ <link rel="stylesheet" href="$home/style.css?default" type="text/css"
327 @ media="screen" />
@@ -340,34 +342,34 @@
342 @ </div>
343 @ <div class="mainmenu">
344 @ <th1>
345 @ html "<a href='$home$index_page'>Home</a>\n"
346 @ if {[anycap jor]} {
347 @ html "<a href='timeline'>Timeline</a>\n"
348 @ }
349 @ if {[hascap oh]} {
350 @ html "<a href='dir?ci=tip'>Files</a>\n"
351 @ }
352 @ if {[hascap o]} {
353 @ html "<a href='brlist'>Branches</a>\n"
354 @ html "<a href='taglist'>Tags</a>\n"
355 @ }
356 @ if {[hascap r]} {
357 @ html "<a href='reportlist'>Tickets</a>\n"
358 @ }
359 @ if {[hascap j]} {
360 @ html "<a href='wiki'>Wiki</a>\n"
361 @ }
362 @ if {[hascap s]} {
363 @ html "<a href='setup'>Admin</a>\n"
364 @ } elseif {[hascap a]} {
365 @ html "<a href='setup_ulist'>Users</a>\n"
366 @ }
367 @ if {[info exists login]} {
368 @ html "<a href='login'>Logout</a>\n"
369 @ } else {
370 @ html "<a href='login'>Login</a>\n"
371 @ }
372 @ </th1></div>
373 ;
374
375 /*
376
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1079,20 +1079,20 @@
10791079
*/
10801080
if( isClosed ){
10811081
if( g.perm.Hyperlink ){
10821082
blob_appendf(p->pOut,
10831083
"%z<span class=\"wikiTagCancelled\">[",
1084
- href("%R/info/%s",zTarget)
1084
+ href("info/%s",zTarget)
10851085
);
10861086
zTerm = "]</span></a>";
10871087
}else{
10881088
blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">[");
10891089
zTerm = "]</span>";
10901090
}
10911091
}else{
10921092
if( g.perm.Hyperlink ){
1093
- blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget));
1093
+ blob_appendf(p->pOut,"%z[", href("info/%s", zTarget));
10941094
zTerm = "]</a>";
10951095
}else{
10961096
blob_appendf(p->pOut, "[");
10971097
zTerm = "]";
10981098
}
@@ -1099,22 +1099,22 @@
10991099
}
11001100
}else if( !in_this_repo(zTarget) ){
11011101
blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget);
11021102
zTerm = "]</span>";
11031103
}else if( g.perm.Hyperlink ){
1104
- blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget));
1104
+ blob_appendf(p->pOut, "%z[",href("info/%s", zTarget));
11051105
zTerm = "]</a>";
11061106
}
11071107
}else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-'
11081108
&& db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){
1109
- blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zTop, zTarget);
1109
+ blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget);
11101110
}else if( strncmp(zTarget, "wiki:", 5)==0
11111111
&& wiki_name_is_wellformed((const unsigned char*)zTarget) ){
11121112
zTarget += 5;
1113
- blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zTop, zTarget);
1113
+ blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget);
11141114
}else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){
1115
- blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zTop, zTarget);
1115
+ blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget);
11161116
}else{
11171117
blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget);
11181118
zTerm = "";
11191119
}
11201120
assert( strlen(zTerm)<nClose );
11211121
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1079,20 +1079,20 @@
1079 */
1080 if( isClosed ){
1081 if( g.perm.Hyperlink ){
1082 blob_appendf(p->pOut,
1083 "%z<span class=\"wikiTagCancelled\">[",
1084 href("%R/info/%s",zTarget)
1085 );
1086 zTerm = "]</span></a>";
1087 }else{
1088 blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">[");
1089 zTerm = "]</span>";
1090 }
1091 }else{
1092 if( g.perm.Hyperlink ){
1093 blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget));
1094 zTerm = "]</a>";
1095 }else{
1096 blob_appendf(p->pOut, "[");
1097 zTerm = "]";
1098 }
@@ -1099,22 +1099,22 @@
1099 }
1100 }else if( !in_this_repo(zTarget) ){
1101 blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget);
1102 zTerm = "]</span>";
1103 }else if( g.perm.Hyperlink ){
1104 blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget));
1105 zTerm = "]</a>";
1106 }
1107 }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-'
1108 && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){
1109 blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zTop, zTarget);
1110 }else if( strncmp(zTarget, "wiki:", 5)==0
1111 && wiki_name_is_wellformed((const unsigned char*)zTarget) ){
1112 zTarget += 5;
1113 blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zTop, zTarget);
1114 }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){
1115 blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zTop, zTarget);
1116 }else{
1117 blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget);
1118 zTerm = "";
1119 }
1120 assert( strlen(zTerm)<nClose );
1121
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1079,20 +1079,20 @@
1079 */
1080 if( isClosed ){
1081 if( g.perm.Hyperlink ){
1082 blob_appendf(p->pOut,
1083 "%z<span class=\"wikiTagCancelled\">[",
1084 href("info/%s",zTarget)
1085 );
1086 zTerm = "]</span></a>";
1087 }else{
1088 blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">[");
1089 zTerm = "]</span>";
1090 }
1091 }else{
1092 if( g.perm.Hyperlink ){
1093 blob_appendf(p->pOut,"%z[", href("info/%s", zTarget));
1094 zTerm = "]</a>";
1095 }else{
1096 blob_appendf(p->pOut, "[");
1097 zTerm = "]";
1098 }
@@ -1099,22 +1099,22 @@
1099 }
1100 }else if( !in_this_repo(zTarget) ){
1101 blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget);
1102 zTerm = "]</span>";
1103 }else if( g.perm.Hyperlink ){
1104 blob_appendf(p->pOut, "%z[",href("info/%s", zTarget));
1105 zTerm = "]</a>";
1106 }
1107 }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-'
1108 && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){
1109 blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget);
1110 }else if( strncmp(zTarget, "wiki:", 5)==0
1111 && wiki_name_is_wellformed((const unsigned char*)zTarget) ){
1112 zTarget += 5;
1113 blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget);
1114 }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){
1115 blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget);
1116 }else{
1117 blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget);
1118 zTerm = "";
1119 }
1120 assert( strlen(zTerm)<nClose );
1121

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button