Fossil SCM

Fix malformed hyperlink for historical revisions of a forum post. Perhaps introduced by [check-in 168eb71643a4]. Reported by [forum post 44505ae8ec51](forum:/forumpost/44505ae8ec515e75).

george 2022-11-19 16:19 trunk
Commit 114b17c4081090ec033406a8cce206f3a027735b919a85a453bd172f86e2c45d
1 file changed +2 -1
+2 -1
--- src/forum.c
+++ src/forum.c
@@ -505,11 +505,11 @@
505505
zHist = bHist ? "" : zQuery[0]==0 ? "?hist" : "&hist";
506506
@ <h3 class='forumPostHdr'>(%d(p->sid)\
507507
@ .%0*d(fossil_num_digits(p->nEdit))(p->rev)) \
508508
if( fossil_strcmp(zPosterName, zEditorName)==0 ){
509509
@ By %s(zPosterName) on %h(zDate) edited from \
510
- @ %z(href("%R/forumpost/%S?%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
510
+ @ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
511511
@ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
512512
}else{
513513
@ Originally by %s(zPosterName) \
514514
@ with edits by %s(zEditorName) on %h(zDate) from \
515515
@ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@@ -706,10 +706,11 @@
706706
zQuery[i++] = 's';
707707
zQuery[i++] = 't';
708708
}
709709
assert( i<sizeof(zQuery) );
710710
zQuery[i] = 0;
711
+ assert( zQuery[0]==0 || zQuery[0]=='?' );
711712
712713
/* Identify which post to display first. If history is shown, start with the
713714
** original, unedited post. Otherwise advance to the post's latest edit. */
714715
if( mode==FD_RAW || mode==FD_SINGLE ){
715716
p = pSelect;
716717
--- src/forum.c
+++ src/forum.c
@@ -505,11 +505,11 @@
505 zHist = bHist ? "" : zQuery[0]==0 ? "?hist" : "&hist";
506 @ <h3 class='forumPostHdr'>(%d(p->sid)\
507 @ .%0*d(fossil_num_digits(p->nEdit))(p->rev)) \
508 if( fossil_strcmp(zPosterName, zEditorName)==0 ){
509 @ By %s(zPosterName) on %h(zDate) edited from \
510 @ %z(href("%R/forumpost/%S?%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
511 @ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
512 }else{
513 @ Originally by %s(zPosterName) \
514 @ with edits by %s(zEditorName) on %h(zDate) from \
515 @ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@@ -706,10 +706,11 @@
706 zQuery[i++] = 's';
707 zQuery[i++] = 't';
708 }
709 assert( i<sizeof(zQuery) );
710 zQuery[i] = 0;
 
711
712 /* Identify which post to display first. If history is shown, start with the
713 ** original, unedited post. Otherwise advance to the post's latest edit. */
714 if( mode==FD_RAW || mode==FD_SINGLE ){
715 p = pSelect;
716
--- src/forum.c
+++ src/forum.c
@@ -505,11 +505,11 @@
505 zHist = bHist ? "" : zQuery[0]==0 ? "?hist" : "&hist";
506 @ <h3 class='forumPostHdr'>(%d(p->sid)\
507 @ .%0*d(fossil_num_digits(p->nEdit))(p->rev)) \
508 if( fossil_strcmp(zPosterName, zEditorName)==0 ){
509 @ By %s(zPosterName) on %h(zDate) edited from \
510 @ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
511 @ %d(p->sid).%0*d(fossil_num_digits(p->nEdit))(p->pEditPrev->rev)</a>
512 }else{
513 @ Originally by %s(zPosterName) \
514 @ with edits by %s(zEditorName) on %h(zDate) from \
515 @ %z(href("%R/forumpost/%S%s%s",p->pEditPrev->zUuid,zQuery,zHist))\
@@ -706,10 +706,11 @@
706 zQuery[i++] = 's';
707 zQuery[i++] = 't';
708 }
709 assert( i<sizeof(zQuery) );
710 zQuery[i] = 0;
711 assert( zQuery[0]==0 || zQuery[0]=='?' );
712
713 /* Identify which post to display first. If history is shown, start with the
714 ** original, unedited post. Otherwise advance to the post's latest edit. */
715 if( mode==FD_RAW || mode==FD_SINGLE ){
716 p = pSelect;
717

Keyboard Shortcuts

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