Fossil SCM

Revise the character escaping logic for generated tarballs and zip archives. Add a "For best results" comment to the configuration page where the project name is set.

drh 2013-10-08 13:45 trunk
Commit fe76ad5567cfba10b156dd2d11a637aa69ac6a86
2 files changed +5 -1 +4 -1
+5 -1
--- src/info.c
+++ src/info.c
@@ -579,11 +579,15 @@
579579
@ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
580580
}
581581
db_finalize(&q2);
582582
}
583583
if( g.perm.Hyperlink ){
584
- char *zProjName = mprintf("%t", db_get("project-name", "unnamed"));
584
+ char *zProjName = mprintf("%s", db_get("project-name", "unnamed"));
585
+ int jj;
586
+ for(jj=0; zProjName[jj]; jj++){
587
+ if( strchr("\\/:*?[]", zProjName[jj]) ) zProjName[jj] = '_';
588
+ }
585589
@ <tr><th>Timelines:</th><td>
586590
@ %z(href("%R/timeline?f=%S",zUuid))family</a>
587591
if( zParent ){
588592
@ | %z(href("%R/timeline?p=%S",zUuid))ancestors</a>
589593
}
590594
--- src/info.c
+++ src/info.c
@@ -579,11 +579,15 @@
579 @ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
580 }
581 db_finalize(&q2);
582 }
583 if( g.perm.Hyperlink ){
584 char *zProjName = mprintf("%t", db_get("project-name", "unnamed"));
 
 
 
 
585 @ <tr><th>Timelines:</th><td>
586 @ %z(href("%R/timeline?f=%S",zUuid))family</a>
587 if( zParent ){
588 @ | %z(href("%R/timeline?p=%S",zUuid))ancestors</a>
589 }
590
--- src/info.c
+++ src/info.c
@@ -579,11 +579,15 @@
579 @ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
580 }
581 db_finalize(&q2);
582 }
583 if( g.perm.Hyperlink ){
584 char *zProjName = mprintf("%s", db_get("project-name", "unnamed"));
585 int jj;
586 for(jj=0; zProjName[jj]; jj++){
587 if( strchr("\\/:*?[]", zProjName[jj]) ) zProjName[jj] = '_';
588 }
589 @ <tr><th>Timelines:</th><td>
590 @ %z(href("%R/timeline?f=%S",zUuid))family</a>
591 if( zParent ){
592 @ | %z(href("%R/timeline?p=%S",zUuid))ancestors</a>
593 }
594
+4 -1
--- src/setup.c
+++ src/setup.c
@@ -1273,11 +1273,14 @@
12731273
@ <form action="%s(g.zTop)/setup_config" method="post"><div>
12741274
login_insert_csrf_secret();
12751275
@ <hr />
12761276
entry_attribute("Project Name", 60, "project-name", "pn", "", 0);
12771277
@ <p>Give your project a name so visitors know what this site is about.
1278
- @ The project name will also be used as the RSS feed title.</p>
1278
+ @ The project name will also be used as the RSS feed title and as the default
1279
+ @ directory name for generated tarballs and ZIP archives. For best results:
1280
+ @ <ul><li>Keep the name short<li>Avoid special characters (ex: "/" and "\")</ul>
1281
+ @ </p>
12791282
@ <hr />
12801283
textarea_attribute("Project Description", 3, 80,
12811284
"project-description", "pd", "", 0);
12821285
@ <p>Describe your project. This will be used in page headers for search
12831286
@ engines as well as a short RSS description.</p>
12841287
--- src/setup.c
+++ src/setup.c
@@ -1273,11 +1273,14 @@
1273 @ <form action="%s(g.zTop)/setup_config" method="post"><div>
1274 login_insert_csrf_secret();
1275 @ <hr />
1276 entry_attribute("Project Name", 60, "project-name", "pn", "", 0);
1277 @ <p>Give your project a name so visitors know what this site is about.
1278 @ The project name will also be used as the RSS feed title.</p>
 
 
 
1279 @ <hr />
1280 textarea_attribute("Project Description", 3, 80,
1281 "project-description", "pd", "", 0);
1282 @ <p>Describe your project. This will be used in page headers for search
1283 @ engines as well as a short RSS description.</p>
1284
--- src/setup.c
+++ src/setup.c
@@ -1273,11 +1273,14 @@
1273 @ <form action="%s(g.zTop)/setup_config" method="post"><div>
1274 login_insert_csrf_secret();
1275 @ <hr />
1276 entry_attribute("Project Name", 60, "project-name", "pn", "", 0);
1277 @ <p>Give your project a name so visitors know what this site is about.
1278 @ The project name will also be used as the RSS feed title and as the default
1279 @ directory name for generated tarballs and ZIP archives. For best results:
1280 @ <ul><li>Keep the name short<li>Avoid special characters (ex: "/" and "\")</ul>
1281 @ </p>
1282 @ <hr />
1283 textarea_attribute("Project Description", 3, 80,
1284 "project-description", "pd", "", 0);
1285 @ <p>Describe your project. This will be used in page headers for search
1286 @ engines as well as a short RSS description.</p>
1287

Keyboard Shortcuts

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