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>
Commit
31732d77ff6c661a14f548db5c036639cf37084f
Parent
0e57bafcfa4d9a9…
5 files changed
+8
+9
+4
+13
-11
+6
-6
+8
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -95,10 +95,18 @@ | ||
| 95 | 95 | default: { |
| 96 | 96 | cgi_panic("bad destination"); |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 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 | +} | |
| 100 | 108 | |
| 101 | 109 | /* |
| 102 | 110 | ** Append reply content to what already exists. |
| 103 | 111 | */ |
| 104 | 112 | void cgi_append_content(const char *zData, int nAmt){ |
| 105 | 113 |
| --- 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 |
+9
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -57,10 +57,19 @@ | ||
| 57 | 57 | if( !g.perm.Setup ){ |
| 58 | 58 | login_needed(); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 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><base href="$baseurl/" /></tt> after <tt><head></tt> | |
| 68 | + @ in the <a href="setup_header">HTML header</a>!</p> | |
| 69 | + } | |
| 70 | + | |
| 62 | 71 | @ <table border="0" cellspacing="7"> |
| 63 | 72 | setup_menu_entry("Users", "setup_ulist", |
| 64 | 73 | "Grant privileges to individual users."); |
| 65 | 74 | setup_menu_entry("Access", "setup_access", |
| 66 | 75 | "Control access settings."); |
| 67 | 76 |
| --- 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><base href="$baseurl/" /></tt> after <tt><head></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 |
+4
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -156,10 +156,11 @@ | ||
| 156 | 156 | @ text-align: right; |
| 157 | 157 | @ padding: 0.2ex 2ex; |
| 158 | 158 | @ }'); |
| 159 | 159 | @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html> |
| 160 | 160 | @ <head> |
| 161 | +@ <base href="$baseurl/" /> | |
| 161 | 162 | @ <title>$<project_name>: $<title></title> |
| 162 | 163 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 163 | 164 | @ href="$home/timeline.rss"> |
| 164 | 165 | @ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css" |
| 165 | 166 | @ media="screen"> |
| @@ -358,10 +359,11 @@ | ||
| 358 | 359 | @ text-align: right; |
| 359 | 360 | @ padding: 0.2ex 2ex; |
| 360 | 361 | @ }'); |
| 361 | 362 | @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html> |
| 362 | 363 | @ <head> |
| 364 | +@ <base href="$baseurl/" /> | |
| 363 | 365 | @ <title>$<project_name>: $<title></title> |
| 364 | 366 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 365 | 367 | @ href="$home/timeline.rss"> |
| 366 | 368 | @ <link rel="stylesheet" href="$home/style.css?tan" type="text/css" |
| 367 | 369 | @ media="screen"> |
| @@ -594,10 +596,11 @@ | ||
| 594 | 596 | @ text-align: right; |
| 595 | 597 | @ padding: 0.2ex 2ex; |
| 596 | 598 | @ }'); |
| 597 | 599 | @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html> |
| 598 | 600 | @ <head> |
| 601 | +@ <base href="$baseurl/" /> | |
| 599 | 602 | @ <title>$<project_name>: $<title></title> |
| 600 | 603 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 601 | 604 | @ href="$home/timeline.rss"> |
| 602 | 605 | @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css" |
| 603 | 606 | @ media="screen"> |
| @@ -892,10 +895,11 @@ | ||
| 892 | 895 | @ textarea { |
| 893 | 896 | @ font-size: 1em; |
| 894 | 897 | @ }'); |
| 895 | 898 | @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html> |
| 896 | 899 | @ <head> |
| 900 | +@ <base href="$baseurl/" /> | |
| 897 | 901 | @ <title>$<project_name>: $<title></title> |
| 898 | 902 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 899 | 903 | @ href="$home/timeline.rss"> |
| 900 | 904 | @ <link rel="stylesheet" href="$home/style.css?black2" type="text/css" |
| 901 | 905 | @ media="screen"> |
| 902 | 906 |
| --- 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 @@ | ||
| 203 | 203 | g.cgiOutput = 1; |
| 204 | 204 | headerHasBeenGenerated = 1; |
| 205 | 205 | sideboxUsed = 0; |
| 206 | 206 | |
| 207 | 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). | |
| 208 | + ** document.getElementById(x) (except that it throws an error | |
| 209 | + ** if the element is not found). | |
| 209 | 210 | ** |
| 210 | 211 | ** Maintenance note: this function must of course be available |
| 211 | 212 | ** before it is called. It "should" go in the HEAD so that client |
| 212 | 213 | ** HEAD code can make use of it, but because the client can replace |
| 213 | 214 | ** the HEAD, and some fossil pages rely on gebi(), we put it here. |
| @@ -316,10 +317,11 @@ | ||
| 316 | 317 | ** The default page header. |
| 317 | 318 | */ |
| 318 | 319 | const char zDefaultHeader[] = |
| 319 | 320 | @ <html> |
| 320 | 321 | @ <head> |
| 322 | +@ <base href="$baseurl/"> | |
| 321 | 323 | @ <title>$<project_name>: $<title></title> |
| 322 | 324 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" |
| 323 | 325 | @ href="$home/timeline.rss" /> |
| 324 | 326 | @ <link rel="stylesheet" href="$home/style.css?default" type="text/css" |
| 325 | 327 | @ media="screen" /> |
| @@ -340,34 +342,34 @@ | ||
| 340 | 342 | @ </div> |
| 341 | 343 | @ <div class="mainmenu"> |
| 342 | 344 | @ <th1> |
| 343 | 345 | @ html "<a href='$home$index_page'>Home</a>\n" |
| 344 | 346 | @ if {[anycap jor]} { |
| 345 | -@ html "<a href='$home/timeline'>Timeline</a>\n" | |
| 347 | +@ html "<a href='timeline'>Timeline</a>\n" | |
| 346 | 348 | @ } |
| 347 | 349 | @ if {[hascap oh]} { |
| 348 | -@ html "<a href='$home/dir?ci=tip'>Files</a>\n" | |
| 350 | +@ html "<a href='dir?ci=tip'>Files</a>\n" | |
| 349 | 351 | @ } |
| 350 | 352 | @ 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" | |
| 353 | 355 | @ } |
| 354 | 356 | @ if {[hascap r]} { |
| 355 | -@ html "<a href='$home/reportlist'>Tickets</a>\n" | |
| 357 | +@ html "<a href='reportlist'>Tickets</a>\n" | |
| 356 | 358 | @ } |
| 357 | 359 | @ if {[hascap j]} { |
| 358 | -@ html "<a href='$home/wiki'>Wiki</a>\n" | |
| 360 | +@ html "<a href='wiki'>Wiki</a>\n" | |
| 359 | 361 | @ } |
| 360 | 362 | @ if {[hascap s]} { |
| 361 | -@ html "<a href='$home/setup'>Admin</a>\n" | |
| 363 | +@ html "<a href='setup'>Admin</a>\n" | |
| 362 | 364 | @ } elseif {[hascap a]} { |
| 363 | -@ html "<a href='$home/setup_ulist'>Users</a>\n" | |
| 365 | +@ html "<a href='setup_ulist'>Users</a>\n" | |
| 364 | 366 | @ } |
| 365 | 367 | @ if {[info exists login]} { |
| 366 | -@ html "<a href='$home/login'>Logout</a>\n" | |
| 368 | +@ html "<a href='login'>Logout</a>\n" | |
| 367 | 369 | @ } else { |
| 368 | -@ html "<a href='$home/login'>Login</a>\n" | |
| 370 | +@ html "<a href='login'>Login</a>\n" | |
| 369 | 371 | @ } |
| 370 | 372 | @ </th1></div> |
| 371 | 373 | ; |
| 372 | 374 | |
| 373 | 375 | /* |
| 374 | 376 |
| --- 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 |
+6
-6
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1079,20 +1079,20 @@ | ||
| 1079 | 1079 | */ |
| 1080 | 1080 | if( isClosed ){ |
| 1081 | 1081 | if( g.perm.Hyperlink ){ |
| 1082 | 1082 | blob_appendf(p->pOut, |
| 1083 | 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | - href("%R/info/%s",zTarget) | |
| 1084 | + href("info/%s",zTarget) | |
| 1085 | 1085 | ); |
| 1086 | 1086 | zTerm = "]</span></a>"; |
| 1087 | 1087 | }else{ |
| 1088 | 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | 1089 | zTerm = "]</span>"; |
| 1090 | 1090 | } |
| 1091 | 1091 | }else{ |
| 1092 | 1092 | 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)); | |
| 1094 | 1094 | zTerm = "]</a>"; |
| 1095 | 1095 | }else{ |
| 1096 | 1096 | blob_appendf(p->pOut, "["); |
| 1097 | 1097 | zTerm = "]"; |
| 1098 | 1098 | } |
| @@ -1099,22 +1099,22 @@ | ||
| 1099 | 1099 | } |
| 1100 | 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | 1102 | zTerm = "]</span>"; |
| 1103 | 1103 | }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)); | |
| 1105 | 1105 | zTerm = "]</a>"; |
| 1106 | 1106 | } |
| 1107 | 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | 1108 | && 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); | |
| 1110 | 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | 1112 | 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); | |
| 1114 | 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); | |
| 1115 | + blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); | |
| 1116 | 1116 | }else{ |
| 1117 | 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | 1118 | zTerm = ""; |
| 1119 | 1119 | } |
| 1120 | 1120 | assert( strlen(zTerm)<nClose ); |
| 1121 | 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("%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 |