Fossil

Check-in [89dd3451]
Login

Check-in [89dd3451]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Do not override base href for wiki pages. This needs testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | base-href-fix
Files: files | file ages | folders
SHA3-256: 89dd34519f454333d777bf8d93cf858241b4702e4184bf5a8dcb4a186332199d
User & Date: george 2022-02-15 02:26:20
Context
2022-02-15
21:35
FIXME-comments in the code did not indicate issues and are now rephrased to be mere reminders. ... (Leaf check-in: d253ece0 user: george tags: base-href-fix)
02:26
Do not override base href for wiki pages. This needs testing. ... (check-in: 89dd3451 user: george tags: base-href-fix)
00:58
When setting $webpagename pass the value of g.zPath though escape_quotes(). This is unclear how g.zPath can contain quotes but let this strange case be handled in a safe way. ... (check-in: 288fe34c user: george tags: base-href-fix)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/fossil.page.wikiedit.js.

881
882
883
884
885
886
887

888


889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907

908


909
910
911
912
913
914
915
          /* Several places make sense for a save button, so we'll
             move that button around to those tabs where it makes sense. */
          btnSlot.parentNode.insertBefore( P.e.btnSave.parentNode, btnSlot );
          btnSlot.parentNode.insertBefore( P.e.btnSaveClose.parentNode, btnSlot );
          P.updateSaveButton();
        }
        if(theTab===P.e.tabs.preview){

          P.baseHrefForWiki();


          if(P.previewNeedsUpdate && P.e.cbAutoPreview.checked) P.preview();
        }else if(theTab===P.e.tabs.diff){
          /* Work around a weird bug where the page gets wider than
             the window when the diff tab is NOT in view and the
             current SBS diff widget is wider than the window. When
             the diff IS in view then CSS overflow magically reduces
             the page size again. Weird. Maybe FF-specific. Note that
             this weirdness happens even though P.e.diffTarget's parent
             is hidden (and therefore P.e.diffTarget is also hidden).
          */
          D.removeClass(P.e.diffTarget, 'hidden');
        }
      }
    );
    P.tabs.addEventListener(
      /* Set up auto-refresh of the preview tab... */
      'before-switch-from', function(ev){
        const theTab = ev.detail;
        if(theTab===P.e.tabs.preview){

          P.baseHrefRestore();


        }else if(theTab===P.e.tabs.diff){
          /* See notes in the before-switch-to handler. */
          D.addClass(P.e.diffTarget, 'hidden');
        }
      }
    );
    ////////////////////////////////////////////////////////////







>
|
>
>



















>
|
>
>







881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
          /* Several places make sense for a save button, so we'll
             move that button around to those tabs where it makes sense. */
          btnSlot.parentNode.insertBefore( P.e.btnSave.parentNode, btnSlot );
          btnSlot.parentNode.insertBefore( P.e.btnSaveClose.parentNode, btnSlot );
          P.updateSaveButton();
        }
        if(theTab===P.e.tabs.preview){

          /* FIXME: P.baseHrefForWiki();
          ** Overriding of base href disabled as part of 'base-href-fix' branch
          */
          if(P.previewNeedsUpdate && P.e.cbAutoPreview.checked) P.preview();
        }else if(theTab===P.e.tabs.diff){
          /* Work around a weird bug where the page gets wider than
             the window when the diff tab is NOT in view and the
             current SBS diff widget is wider than the window. When
             the diff IS in view then CSS overflow magically reduces
             the page size again. Weird. Maybe FF-specific. Note that
             this weirdness happens even though P.e.diffTarget's parent
             is hidden (and therefore P.e.diffTarget is also hidden).
          */
          D.removeClass(P.e.diffTarget, 'hidden');
        }
      }
    );
    P.tabs.addEventListener(
      /* Set up auto-refresh of the preview tab... */
      'before-switch-from', function(ev){
        const theTab = ev.detail;
        if(theTab===P.e.tabs.preview){

          /* FIXME: P.baseHrefRestore();
          ** Overriding of base href disabled as part of 'base-href-fix' branch
          */
        }else if(theTab===P.e.tabs.diff){
          /* See notes in the before-switch-to handler. */
          D.addClass(P.e.diffTarget, 'hidden');
        }
      }
    );
    ////////////////////////////////////////////////////////////

Changes to src/wiki.c.

595
596
597
598
599
600
601

602


603
604
605
606
607
608
609
    }
    if( g.perm.Hyperlink ){
      style_submenu_element("History", "%R/whistory?name=%T", zPageName);
    }
  }
  if( !isPopup ){
    style_set_current_page("%T?name=%T", g.zPath, zPageName);

    style_set_base_href_suffix("%T?name=%T", g.zPath, zPageName);


    wiki_page_header(WIKITYPE_UNKNOWN, zPageName, "");
    if( !noSubmenu ){
      wiki_standard_submenu(submenuFlags);
    }
  }
  if( zBody[0]==0 ){
    @ <i>This page has been deleted</i>







>
|
>
>







595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
    }
    if( g.perm.Hyperlink ){
      style_submenu_element("History", "%R/whistory?name=%T", zPageName);
    }
  }
  if( !isPopup ){
    style_set_current_page("%T?name=%T", g.zPath, zPageName);

    /* FIXME: style_set_base_href_suffix("%T?name=%T", g.zPath, zPageName);
    ** Overriding of base href disabled as part of 'base-href-fix' branch
    */
    wiki_page_header(WIKITYPE_UNKNOWN, zPageName, "");
    if( !noSubmenu ){
      wiki_standard_submenu(submenuFlags);
    }
  }
  if( zBody[0]==0 ){
    @ <i>This page has been deleted</i>
1668
1669
1670
1671
1672
1673
1674

1675


1676
1677
1678
1679
1680
1681
1682
  }
  if( !isSandbox && P("cancel")!=0 ){
    manifest_destroy(pWiki);
    cgi_redirectf("wiki?name=%T", zPageName);
    return;
  }
  style_set_current_page("%T?name=%T", g.zPath, zPageName);

  style_set_base_href_suffix("%T?name=%T", g.zPath, zPageName);


  style_set_current_feature("wiki");
  style_header("Append Comment To: %s", zPageName);
  if( !goodCaptcha ){
    @ <p class="generalError">Error: Incorrect security code.</p>
  }
  if( isSandbox ){
    @ <p class="generalError">Error: the Sandbox page may not







>
|
>
>







1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
  }
  if( !isSandbox && P("cancel")!=0 ){
    manifest_destroy(pWiki);
    cgi_redirectf("wiki?name=%T", zPageName);
    return;
  }
  style_set_current_page("%T?name=%T", g.zPath, zPageName);

  /* FIXME: style_set_base_href_suffix("%T?name=%T", g.zPath, zPageName);
  ** Overriding of base href disabled as part of 'base-href-fix' branch
  */
  style_set_current_feature("wiki");
  style_header("Append Comment To: %s", zPageName);
  if( !goodCaptcha ){
    @ <p class="generalError">Error: Incorrect security code.</p>
  }
  if( isSandbox ){
    @ <p class="generalError">Error: the Sandbox page may not