Fossil SCM

Add an overlooked call to <code>style_set_base_href_suffix()</code> in src/info.c and add a comment of why not to do so for [/help?cmd=/ext|/ext]

george 2022-02-12 21:51 base-href-fix
Commit 87fba73120dec008593668680b040418eed45bc54b9151af58db894dcb772558
2 files changed +4 +1
--- src/extcgi.c
+++ src/extcgi.c
@@ -228,10 +228,14 @@
228228
zFailReason = "path does not match any file or script";
229229
goto ext_not_found;
230230
}
231231
assert( nScript>=nRoot+1 );
232232
style_set_current_page("ext/%s", &zScript[nRoot+1]);
233
+
234
+ /* FIXME: a call to style_set_base_href_suffix() skipped
235
+ * because we want #fragment links to work under /ext */
236
+
233237
zMime = mimetype_from_name(zScript);
234238
if( zMime==0 ) zMime = "application/octet-stream";
235239
if( !file_isexe(zScript, ExtFILE) ){
236240
/* File is not executable. Must be a regular file. In that case,
237241
** disallow extra path elements */
238242
--- src/extcgi.c
+++ src/extcgi.c
@@ -228,10 +228,14 @@
228 zFailReason = "path does not match any file or script";
229 goto ext_not_found;
230 }
231 assert( nScript>=nRoot+1 );
232 style_set_current_page("ext/%s", &zScript[nRoot+1]);
 
 
 
 
233 zMime = mimetype_from_name(zScript);
234 if( zMime==0 ) zMime = "application/octet-stream";
235 if( !file_isexe(zScript, ExtFILE) ){
236 /* File is not executable. Must be a regular file. In that case,
237 ** disallow extra path elements */
238
--- src/extcgi.c
+++ src/extcgi.c
@@ -228,10 +228,14 @@
228 zFailReason = "path does not match any file or script";
229 goto ext_not_found;
230 }
231 assert( nScript>=nRoot+1 );
232 style_set_current_page("ext/%s", &zScript[nRoot+1]);
233
234 /* FIXME: a call to style_set_base_href_suffix() skipped
235 * because we want #fragment links to work under /ext */
236
237 zMime = mimetype_from_name(zScript);
238 if( zMime==0 ) zMime = "application/octet-stream";
239 if( !file_isexe(zScript, ExtFILE) ){
240 /* File is not executable. Must be a regular file. In that case,
241 ** disallow extra path elements */
242
+1
--- src/info.c
+++ src/info.c
@@ -2583,10 +2583,11 @@
25832583
style_set_current_page("doc/%S/%T", zCIUuid, zName);
25842584
style_set_base_href_suffix("doc/%S/%T", zCIUuid, zName);
25852585
}else{
25862586
zHeader = mprintf("%s", file_tail(zName));
25872587
style_set_current_page("doc/tip/%T", zName);
2588
+ style_set_base_href_suffix("doc/tip/%T", zName);
25882589
}
25892590
}else if( descOnly ){
25902591
zHeader = mprintf("Artifact Description [%S]", zUuid);
25912592
}else{
25922593
zHeader = mprintf("Artifact [%S]", zUuid);
25932594
--- src/info.c
+++ src/info.c
@@ -2583,10 +2583,11 @@
2583 style_set_current_page("doc/%S/%T", zCIUuid, zName);
2584 style_set_base_href_suffix("doc/%S/%T", zCIUuid, zName);
2585 }else{
2586 zHeader = mprintf("%s", file_tail(zName));
2587 style_set_current_page("doc/tip/%T", zName);
 
2588 }
2589 }else if( descOnly ){
2590 zHeader = mprintf("Artifact Description [%S]", zUuid);
2591 }else{
2592 zHeader = mprintf("Artifact [%S]", zUuid);
2593
--- src/info.c
+++ src/info.c
@@ -2583,10 +2583,11 @@
2583 style_set_current_page("doc/%S/%T", zCIUuid, zName);
2584 style_set_base_href_suffix("doc/%S/%T", zCIUuid, zName);
2585 }else{
2586 zHeader = mprintf("%s", file_tail(zName));
2587 style_set_current_page("doc/tip/%T", zName);
2588 style_set_base_href_suffix("doc/tip/%T", zName);
2589 }
2590 }else if( descOnly ){
2591 zHeader = mprintf("Artifact Description [%S]", zUuid);
2592 }else{
2593 zHeader = mprintf("Artifact [%S]", zUuid);
2594

Keyboard Shortcuts

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