Fossil SCM

Change the minimum length for wiki page names from 3 to 1.

joel 2013-12-17 06:04 trunk
Commit b7ff13a0aa6317f224fa9af84d5f975b33c1dfdf
1 file changed +3 -3
+3 -3
--- src/wiki.c
+++ src/wiki.c
@@ -27,11 +27,11 @@
2727
** Return true if the input string is a well-formed wiki page name.
2828
**
2929
** Well-formed wiki page names do not begin or end with whitespace,
3030
** and do not contain tabs or other control characters and do not
3131
** contain more than a single space character in a row. Well-formed
32
-** names must be between 3 and 100 characters in length, inclusive.
32
+** names must be between 1 and 100 characters in length, inclusive.
3333
*/
3434
int wiki_name_is_wellformed(const unsigned char *z){
3535
int i;
3636
if( z[0]<=0x20 ){
3737
return 0;
@@ -39,11 +39,11 @@
3939
for(i=1; z[i]; i++){
4040
if( z[i]<0x20 ) return 0;
4141
if( z[i]==0x20 && z[i-1]==0x20 ) return 0;
4242
}
4343
if( z[i-1]==' ' ) return 0;
44
- if( i<3 || i>100 ) return 0;
44
+ if( i<1 || i>100 ) return 0;
4545
return 1;
4646
}
4747
4848
/*
4949
** Output rules for well-formed wiki pages
@@ -52,11 +52,11 @@
5252
@ <ul>
5353
@ <li> Must not begin or end with a space.</li>
5454
@ <li> Must not contain any control characters, including tab or
5555
@ newline.</li>
5656
@ <li> Must not have two or more spaces in a row internally.</li>
57
- @ <li> Must be between 3 and 100 characters in length.</li>
57
+ @ <li> Must be between 1 and 100 characters in length.</li>
5858
@ </ul>
5959
}
6060
6161
/*
6262
** Check a wiki name. If it is not well-formed, then issue an error
6363
--- src/wiki.c
+++ src/wiki.c
@@ -27,11 +27,11 @@
27 ** Return true if the input string is a well-formed wiki page name.
28 **
29 ** Well-formed wiki page names do not begin or end with whitespace,
30 ** and do not contain tabs or other control characters and do not
31 ** contain more than a single space character in a row. Well-formed
32 ** names must be between 3 and 100 characters in length, inclusive.
33 */
34 int wiki_name_is_wellformed(const unsigned char *z){
35 int i;
36 if( z[0]<=0x20 ){
37 return 0;
@@ -39,11 +39,11 @@
39 for(i=1; z[i]; i++){
40 if( z[i]<0x20 ) return 0;
41 if( z[i]==0x20 && z[i-1]==0x20 ) return 0;
42 }
43 if( z[i-1]==' ' ) return 0;
44 if( i<3 || i>100 ) return 0;
45 return 1;
46 }
47
48 /*
49 ** Output rules for well-formed wiki pages
@@ -52,11 +52,11 @@
52 @ <ul>
53 @ <li> Must not begin or end with a space.</li>
54 @ <li> Must not contain any control characters, including tab or
55 @ newline.</li>
56 @ <li> Must not have two or more spaces in a row internally.</li>
57 @ <li> Must be between 3 and 100 characters in length.</li>
58 @ </ul>
59 }
60
61 /*
62 ** Check a wiki name. If it is not well-formed, then issue an error
63
--- src/wiki.c
+++ src/wiki.c
@@ -27,11 +27,11 @@
27 ** Return true if the input string is a well-formed wiki page name.
28 **
29 ** Well-formed wiki page names do not begin or end with whitespace,
30 ** and do not contain tabs or other control characters and do not
31 ** contain more than a single space character in a row. Well-formed
32 ** names must be between 1 and 100 characters in length, inclusive.
33 */
34 int wiki_name_is_wellformed(const unsigned char *z){
35 int i;
36 if( z[0]<=0x20 ){
37 return 0;
@@ -39,11 +39,11 @@
39 for(i=1; z[i]; i++){
40 if( z[i]<0x20 ) return 0;
41 if( z[i]==0x20 && z[i-1]==0x20 ) return 0;
42 }
43 if( z[i-1]==' ' ) return 0;
44 if( i<1 || i>100 ) return 0;
45 return 1;
46 }
47
48 /*
49 ** Output rules for well-formed wiki pages
@@ -52,11 +52,11 @@
52 @ <ul>
53 @ <li> Must not begin or end with a space.</li>
54 @ <li> Must not contain any control characters, including tab or
55 @ newline.</li>
56 @ <li> Must not have two or more spaces in a row internally.</li>
57 @ <li> Must be between 1 and 100 characters in length.</li>
58 @ </ul>
59 }
60
61 /*
62 ** Check a wiki name. If it is not well-formed, then issue an error
63

Keyboard Shortcuts

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