Fossil SCM
The "Code" on an inter-wiki link must be ascii alphanumeric. Sync the inter-wiki config table entries on clone.
Commit
550536789fbefa43f825908300577f568b34bd48cefdc29f9b52cc581531eed7
Parent
3ca23edc8fe0530…
2 files changed
+35
-12
+4
-2
+35
-12
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -37,11 +37,12 @@ | ||
| 37 | 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | 41 | #define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */ |
| 42 | -#define CONFIGSET_ALL 0x0003ff /* Everything */ | |
| 42 | +#define CONFIGSET_IWIKI 0x000400 /* Interwiki codes */ | |
| 43 | +#define CONFIGSET_ALL 0x0007ff /* Everything */ | |
| 43 | 44 | |
| 44 | 45 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| 45 | 46 | |
| 46 | 47 | /* |
| 47 | 48 | ** This mask is used for the common TH1 configuration settings (i.e. those |
| @@ -58,22 +59,23 @@ | ||
| 58 | 59 | static struct { |
| 59 | 60 | const char *zName; /* Name of the configuration set */ |
| 60 | 61 | int groupMask; /* Mask for that configuration set */ |
| 61 | 62 | const char *zHelp; /* What it does */ |
| 62 | 63 | } aGroupName[] = { |
| 63 | - { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, | |
| 64 | - { "/project", CONFIGSET_PROJ, "Project name and description" }, | |
| 64 | + { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, | |
| 65 | + { "/project", CONFIGSET_PROJ, "Project name and description" }, | |
| 65 | 66 | { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, |
| 66 | - "Web interface appearance settings" }, | |
| 67 | - { "/css", CONFIGSET_CSS, "Style sheet" }, | |
| 68 | - { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, | |
| 69 | - { "/ticket", CONFIGSET_TKT, "Ticket setup", }, | |
| 70 | - { "/user", CONFIGSET_USER, "Users and privilege settings" }, | |
| 71 | - { "/xfer", CONFIGSET_XFER, "Transfer setup", }, | |
| 72 | - { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, | |
| 73 | - { "/subscriber", CONFIGSET_SCRIBER,"Email notification subscriber list" }, | |
| 74 | - { "/all", CONFIGSET_ALL, "All of the above" }, | |
| 67 | + "Web interface appearance settings" }, | |
| 68 | + { "/css", CONFIGSET_CSS, "Style sheet" }, | |
| 69 | + { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, | |
| 70 | + { "/ticket", CONFIGSET_TKT, "Ticket setup", }, | |
| 71 | + { "/user", CONFIGSET_USER, "Users and privilege settings" }, | |
| 72 | + { "/xfer", CONFIGSET_XFER, "Transfer setup", }, | |
| 73 | + { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, | |
| 74 | + { "/subscriber", CONFIGSET_SCRIBER, "Email notification subscriber list" }, | |
| 75 | + { "/interwiki", CONFIGSET_IWIKI, "Inter-wiki link prefixes" }, | |
| 76 | + { "/all", CONFIGSET_ALL, "All of the above" }, | |
| 75 | 77 | }; |
| 76 | 78 | |
| 77 | 79 | |
| 78 | 80 | /* |
| 79 | 81 | ** The following is a list of settings that we are willing to |
| @@ -175,10 +177,12 @@ | ||
| 175 | 177 | |
| 176 | 178 | { "@alias", CONFIGSET_ALIAS }, |
| 177 | 179 | |
| 178 | 180 | { "@subscriber", CONFIGSET_SCRIBER }, |
| 179 | 181 | |
| 182 | + { "@interwiki", CONFIGSET_IWIKI }, | |
| 183 | + | |
| 180 | 184 | { "xfer-common-script", CONFIGSET_XFER }, |
| 181 | 185 | { "xfer-push-script", CONFIGSET_XFER }, |
| 182 | 186 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 183 | 187 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| 184 | 188 | |
| @@ -257,10 +261,13 @@ | ||
| 257 | 261 | return m; |
| 258 | 262 | } |
| 259 | 263 | } |
| 260 | 264 | if( strncmp(zName, "walias:/", 8)==0 ){ |
| 261 | 265 | return CONFIGSET_ALIAS; |
| 266 | + } | |
| 267 | + if( strncmp(zName, "intermap:/", 10)==0 ){ | |
| 268 | + return CONFIGSET_PROJ; | |
| 262 | 269 | } |
| 263 | 270 | return 0; |
| 264 | 271 | } |
| 265 | 272 | |
| 266 | 273 | /* |
| @@ -587,10 +594,26 @@ | ||
| 587 | 594 | while( db_step(&q)==SQLITE_ROW ){ |
| 588 | 595 | blob_appendf(&rec,"%s %s value %s", |
| 589 | 596 | db_column_text(&q, 0), |
| 590 | 597 | db_column_text(&q, 1), |
| 591 | 598 | db_column_text(&q, 2) |
| 599 | + ); | |
| 600 | + blob_appendf(pOut, "config /config %d\n%s\n", | |
| 601 | + blob_size(&rec), blob_str(&rec)); | |
| 602 | + nCard++; | |
| 603 | + blob_reset(&rec); | |
| 604 | + } | |
| 605 | + db_finalize(&q); | |
| 606 | + } | |
| 607 | + if( groupMask & CONFIGSET_IWIKI ){ | |
| 608 | + db_prepare(&q, "SELECT mtime, quote(name), quote(value) FROM config" | |
| 609 | + " WHERE name GLOB 'intermap:/*' AND mtime>=%lld", iStart); | |
| 610 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 611 | + blob_appendf(&rec,"%s %s value %s", | |
| 612 | + db_column_text(&q, 0), | |
| 613 | + db_column_text(&q, 1), | |
| 614 | + db_column_text(&q, 2) | |
| 592 | 615 | ); |
| 593 | 616 | blob_appendf(pOut, "config /config %d\n%s\n", |
| 594 | 617 | blob_size(&rec), blob_str(&rec)); |
| 595 | 618 | nCard++; |
| 596 | 619 | blob_reset(&rec); |
| 597 | 620 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -37,11 +37,12 @@ | |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */ |
| 42 | #define CONFIGSET_ALL 0x0003ff /* Everything */ |
| 43 | |
| 44 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| 45 | |
| 46 | /* |
| 47 | ** This mask is used for the common TH1 configuration settings (i.e. those |
| @@ -58,22 +59,23 @@ | |
| 58 | static struct { |
| 59 | const char *zName; /* Name of the configuration set */ |
| 60 | int groupMask; /* Mask for that configuration set */ |
| 61 | const char *zHelp; /* What it does */ |
| 62 | } aGroupName[] = { |
| 63 | { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, |
| 64 | { "/project", CONFIGSET_PROJ, "Project name and description" }, |
| 65 | { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, |
| 66 | "Web interface appearance settings" }, |
| 67 | { "/css", CONFIGSET_CSS, "Style sheet" }, |
| 68 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 69 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 70 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 71 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 72 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 73 | { "/subscriber", CONFIGSET_SCRIBER,"Email notification subscriber list" }, |
| 74 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 75 | }; |
| 76 | |
| 77 | |
| 78 | /* |
| 79 | ** The following is a list of settings that we are willing to |
| @@ -175,10 +177,12 @@ | |
| 175 | |
| 176 | { "@alias", CONFIGSET_ALIAS }, |
| 177 | |
| 178 | { "@subscriber", CONFIGSET_SCRIBER }, |
| 179 | |
| 180 | { "xfer-common-script", CONFIGSET_XFER }, |
| 181 | { "xfer-push-script", CONFIGSET_XFER }, |
| 182 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 183 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| 184 | |
| @@ -257,10 +261,13 @@ | |
| 257 | return m; |
| 258 | } |
| 259 | } |
| 260 | if( strncmp(zName, "walias:/", 8)==0 ){ |
| 261 | return CONFIGSET_ALIAS; |
| 262 | } |
| 263 | return 0; |
| 264 | } |
| 265 | |
| 266 | /* |
| @@ -587,10 +594,26 @@ | |
| 587 | while( db_step(&q)==SQLITE_ROW ){ |
| 588 | blob_appendf(&rec,"%s %s value %s", |
| 589 | db_column_text(&q, 0), |
| 590 | db_column_text(&q, 1), |
| 591 | db_column_text(&q, 2) |
| 592 | ); |
| 593 | blob_appendf(pOut, "config /config %d\n%s\n", |
| 594 | blob_size(&rec), blob_str(&rec)); |
| 595 | nCard++; |
| 596 | blob_reset(&rec); |
| 597 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -37,11 +37,12 @@ | |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */ |
| 42 | #define CONFIGSET_IWIKI 0x000400 /* Interwiki codes */ |
| 43 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 44 | |
| 45 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| 46 | |
| 47 | /* |
| 48 | ** This mask is used for the common TH1 configuration settings (i.e. those |
| @@ -58,22 +59,23 @@ | |
| 59 | static struct { |
| 60 | const char *zName; /* Name of the configuration set */ |
| 61 | int groupMask; /* Mask for that configuration set */ |
| 62 | const char *zHelp; /* What it does */ |
| 63 | } aGroupName[] = { |
| 64 | { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, |
| 65 | { "/project", CONFIGSET_PROJ, "Project name and description" }, |
| 66 | { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, |
| 67 | "Web interface appearance settings" }, |
| 68 | { "/css", CONFIGSET_CSS, "Style sheet" }, |
| 69 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 70 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 71 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 72 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 73 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 74 | { "/subscriber", CONFIGSET_SCRIBER, "Email notification subscriber list" }, |
| 75 | { "/interwiki", CONFIGSET_IWIKI, "Inter-wiki link prefixes" }, |
| 76 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 77 | }; |
| 78 | |
| 79 | |
| 80 | /* |
| 81 | ** The following is a list of settings that we are willing to |
| @@ -175,10 +177,12 @@ | |
| 177 | |
| 178 | { "@alias", CONFIGSET_ALIAS }, |
| 179 | |
| 180 | { "@subscriber", CONFIGSET_SCRIBER }, |
| 181 | |
| 182 | { "@interwiki", CONFIGSET_IWIKI }, |
| 183 | |
| 184 | { "xfer-common-script", CONFIGSET_XFER }, |
| 185 | { "xfer-push-script", CONFIGSET_XFER }, |
| 186 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 187 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| 188 | |
| @@ -257,10 +261,13 @@ | |
| 261 | return m; |
| 262 | } |
| 263 | } |
| 264 | if( strncmp(zName, "walias:/", 8)==0 ){ |
| 265 | return CONFIGSET_ALIAS; |
| 266 | } |
| 267 | if( strncmp(zName, "intermap:/", 10)==0 ){ |
| 268 | return CONFIGSET_PROJ; |
| 269 | } |
| 270 | return 0; |
| 271 | } |
| 272 | |
| 273 | /* |
| @@ -587,10 +594,26 @@ | |
| 594 | while( db_step(&q)==SQLITE_ROW ){ |
| 595 | blob_appendf(&rec,"%s %s value %s", |
| 596 | db_column_text(&q, 0), |
| 597 | db_column_text(&q, 1), |
| 598 | db_column_text(&q, 2) |
| 599 | ); |
| 600 | blob_appendf(pOut, "config /config %d\n%s\n", |
| 601 | blob_size(&rec), blob_str(&rec)); |
| 602 | nCard++; |
| 603 | blob_reset(&rec); |
| 604 | } |
| 605 | db_finalize(&q); |
| 606 | } |
| 607 | if( groupMask & CONFIGSET_IWIKI ){ |
| 608 | db_prepare(&q, "SELECT mtime, quote(name), quote(value) FROM config" |
| 609 | " WHERE name GLOB 'intermap:/*' AND mtime>=%lld", iStart); |
| 610 | while( db_step(&q)==SQLITE_ROW ){ |
| 611 | blob_appendf(&rec,"%s %s value %s", |
| 612 | db_column_text(&q, 0), |
| 613 | db_column_text(&q, 1), |
| 614 | db_column_text(&q, 2) |
| 615 | ); |
| 616 | blob_appendf(pOut, "config /config %d\n%s\n", |
| 617 | blob_size(&rec), blob_str(&rec)); |
| 618 | nCard++; |
| 619 | blob_reset(&rec); |
| 620 |
+4
-2
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1208,10 +1208,12 @@ | ||
| 1208 | 1208 | ** An interwiki link target is of the form: |
| 1209 | 1209 | ** |
| 1210 | 1210 | ** Code:PageName |
| 1211 | 1211 | ** |
| 1212 | 1212 | ** "Code" is a brief code that describes the intended target wiki. |
| 1213 | +** The code must be ASCII alpha-numeric. No symbols or non-ascii | |
| 1214 | +** characters are allows. Case is ignored for the code. | |
| 1213 | 1215 | ** Codes are assigned by "intermap:*" entries in the CONFIG table. |
| 1214 | 1216 | ** The link is only valid if there exists an try in the CONFIG table |
| 1215 | 1217 | ** that matches "intermap:Code". |
| 1216 | 1218 | ** |
| 1217 | 1219 | ** Each value of each intermap:Code entry in the CONFIG table is a JSON |
| @@ -1251,12 +1253,12 @@ | ||
| 1251 | 1253 | int i; |
| 1252 | 1254 | const char *zPage; |
| 1253 | 1255 | int nPage; |
| 1254 | 1256 | char *zUrl = 0; |
| 1255 | 1257 | Stmt q; |
| 1256 | - for(i=0; zTarget[i] && zTarget[i]!=':'; i++){} | |
| 1257 | - if( zTarget[i]==0 ) return 0; | |
| 1258 | + for(i=0; fossil_isalnum(zTarget[i]); i++){} | |
| 1259 | + if( zTarget[i]!=':' ) return 0; | |
| 1258 | 1260 | nCode = i; |
| 1259 | 1261 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 1260 | 1262 | zPage = zTarget + nCode + 1; |
| 1261 | 1263 | nPage = (int)strlen(zPage); |
| 1262 | 1264 | db_prepare(&q, |
| 1263 | 1265 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1208,10 +1208,12 @@ | |
| 1208 | ** An interwiki link target is of the form: |
| 1209 | ** |
| 1210 | ** Code:PageName |
| 1211 | ** |
| 1212 | ** "Code" is a brief code that describes the intended target wiki. |
| 1213 | ** Codes are assigned by "intermap:*" entries in the CONFIG table. |
| 1214 | ** The link is only valid if there exists an try in the CONFIG table |
| 1215 | ** that matches "intermap:Code". |
| 1216 | ** |
| 1217 | ** Each value of each intermap:Code entry in the CONFIG table is a JSON |
| @@ -1251,12 +1253,12 @@ | |
| 1251 | int i; |
| 1252 | const char *zPage; |
| 1253 | int nPage; |
| 1254 | char *zUrl = 0; |
| 1255 | Stmt q; |
| 1256 | for(i=0; zTarget[i] && zTarget[i]!=':'; i++){} |
| 1257 | if( zTarget[i]==0 ) return 0; |
| 1258 | nCode = i; |
| 1259 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 1260 | zPage = zTarget + nCode + 1; |
| 1261 | nPage = (int)strlen(zPage); |
| 1262 | db_prepare(&q, |
| 1263 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1208,10 +1208,12 @@ | |
| 1208 | ** An interwiki link target is of the form: |
| 1209 | ** |
| 1210 | ** Code:PageName |
| 1211 | ** |
| 1212 | ** "Code" is a brief code that describes the intended target wiki. |
| 1213 | ** The code must be ASCII alpha-numeric. No symbols or non-ascii |
| 1214 | ** characters are allows. Case is ignored for the code. |
| 1215 | ** Codes are assigned by "intermap:*" entries in the CONFIG table. |
| 1216 | ** The link is only valid if there exists an try in the CONFIG table |
| 1217 | ** that matches "intermap:Code". |
| 1218 | ** |
| 1219 | ** Each value of each intermap:Code entry in the CONFIG table is a JSON |
| @@ -1251,12 +1253,12 @@ | |
| 1253 | int i; |
| 1254 | const char *zPage; |
| 1255 | int nPage; |
| 1256 | char *zUrl = 0; |
| 1257 | Stmt q; |
| 1258 | for(i=0; fossil_isalnum(zTarget[i]); i++){} |
| 1259 | if( zTarget[i]!=':' ) return 0; |
| 1260 | nCode = i; |
| 1261 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 1262 | zPage = zTarget + nCode + 1; |
| 1263 | nPage = (int)strlen(zPage); |
| 1264 | db_prepare(&q, |
| 1265 |