Fossil

Check-in [534b060007]
Login

Check-in [534b060007]

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

Overview
Comment:Fix the repolist function for CGI server invocations, apparently broken by check-in [ec56c69fe98d26d9]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 534b060007692cc87a8c3e14d7d048b51c1b098e16c5127dc6d68b53aec2b44d
User & Date: drh 2019-08-03 19:49:52.391
Context
2019-08-04
20:23
Improvements to the Security-Audit page - mostly in providing additional information about the files in the CGI extension folder. ... (check-in: a3bc6552ee user: drh tags: trunk)
2019-08-03
19:49
Fix the repolist function for CGI server invocations, apparently broken by check-in [ec56c69fe98d26d9] ... (check-in: 534b060007 user: drh tags: trunk)
01:07
merge to logical conclusion (nop) ... (check-in: f4f9c1090b user: bch tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
      /* If we reach this point, it means that the search of the PATH_INFO
      ** string is finished.  Either zRepo contains the name of the
      ** repository to be used, or else no repository could be found an
      ** some kind of error response is required.
      */
      if( szFile<1024 ){
        set_base_url(0);
        if( strcmp(zPathInfo,"/")==0
                  && allowRepoList
                  && repo_list_page() ){
          /* Will return a list of repositories */
        }else if( zNotFound ){
          cgi_redirect(zNotFound);
        }else{
#ifdef FOSSIL_ENABLE_JSON







|







1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
      /* If we reach this point, it means that the search of the PATH_INFO
      ** string is finished.  Either zRepo contains the name of the
      ** repository to be used, or else no repository could be found an
      ** some kind of error response is required.
      */
      if( szFile<1024 ){
        set_base_url(0);
        if( (zPathInfo[0]==0 || strcmp(zPathInfo,"/")==0)
                  && allowRepoList
                  && repo_list_page() ){
          /* Will return a list of repositories */
        }else if( zNotFound ){
          cgi_redirect(zNotFound);
        }else{
#ifdef FOSSIL_ENABLE_JSON
Changes to src/repolist.c.
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        ** So do not hyperlink those cases. */
        blob_append_sql(&html,"%h",zName);
      } else if( sqlite3_strglob("*/.*", zName)==0 ){
        /* Do not show hyperlinks for hidden repos */
        blob_append_sql(&html, "%h (hidden)", zName);
      } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
        blob_append_sql(&html,
          "<a href='/%T/home' target='_blank'>/%h</a>\n",
          zUrl, zName);
      }else{
        blob_append_sql(&html,
          "<a href='/%T/home' target='_blank'>%h</a>\n",
          zUrl, zName);
      }
      if( x.zProjName ){
        blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
        fossil_free(x.zProjName);
      }else{
        blob_append_sql(&html, "<td></td><td></td>\n");







|



|







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        ** So do not hyperlink those cases. */
        blob_append_sql(&html,"%h",zName);
      } else if( sqlite3_strglob("*/.*", zName)==0 ){
        /* Do not show hyperlinks for hidden repos */
        blob_append_sql(&html, "%h (hidden)", zName);
      } else if( allRepo && sqlite3_strglob("[a-zA-Z]:/?*", zName)!=0 ){
        blob_append_sql(&html,
          "<a href='%R/%T/home' target='_blank'>/%h</a>\n",
          zUrl, zName);
      }else{
        blob_append_sql(&html,
          "<a href='%R/%T/home' target='_blank'>%h</a>\n",
          zUrl, zName);
      }
      if( x.zProjName ){
        blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
        fossil_free(x.zProjName);
      }else{
        blob_append_sql(&html, "<td></td><td></td>\n");