Fossil SCM

Rename P_NoSQL and PD_NoSQL to P(D)_AntiSpider to make their intent clearer and the names more generic.

stephan 2023-02-07 16:48 trunk
Commit 91d13592a75a2227d6526435d58505504d8d9018ed579765962743fc4a43a311
2 files changed +2 -2 +5 -5
+2 -2
--- src/cgi.c
+++ src/cgi.c
@@ -101,12 +101,12 @@
101101
#define PT(x) cgi_parameter_trimmed((x),0)
102102
#define PDT(x,y) cgi_parameter_trimmed((x),(y))
103103
#define PB(x) cgi_parameter_boolean(x)
104104
#define PCK(x) cgi_parameter_checked(x,1)
105105
#define PIF(x,y) cgi_parameter_checked(x,y)
106
-#define P_NoSQL(x) cgi_parameter_nosql((x),0)
107
-#define PD_NoSQL(x,y) cgi_parameter_nosql((x),(y))
106
+#define P_AntiSpider(x) cgi_parameter_nosql((x),0)
107
+#define PD_AntiSpider(x,y) cgi_parameter_nosql((x),(y))
108108
109109
/*
110110
** Shortcut for the cgi_printf() routine. Instead of using the
111111
**
112112
** @ ...
113113
--- src/cgi.c
+++ src/cgi.c
@@ -101,12 +101,12 @@
101 #define PT(x) cgi_parameter_trimmed((x),0)
102 #define PDT(x,y) cgi_parameter_trimmed((x),(y))
103 #define PB(x) cgi_parameter_boolean(x)
104 #define PCK(x) cgi_parameter_checked(x,1)
105 #define PIF(x,y) cgi_parameter_checked(x,y)
106 #define P_NoSQL(x) cgi_parameter_nosql((x),0)
107 #define PD_NoSQL(x,y) cgi_parameter_nosql((x),(y))
108
109 /*
110 ** Shortcut for the cgi_printf() routine. Instead of using the
111 **
112 ** @ ...
113
--- src/cgi.c
+++ src/cgi.c
@@ -101,12 +101,12 @@
101 #define PT(x) cgi_parameter_trimmed((x),0)
102 #define PDT(x,y) cgi_parameter_trimmed((x),(y))
103 #define PB(x) cgi_parameter_boolean(x)
104 #define PCK(x) cgi_parameter_checked(x,1)
105 #define PIF(x,y) cgi_parameter_checked(x,y)
106 #define P_AntiSpider(x) cgi_parameter_nosql((x),0)
107 #define PD_AntiSpider(x,y) cgi_parameter_nosql((x),(y))
108
109 /*
110 ** Shortcut for the cgi_printf() routine. Instead of using the
111 **
112 ** @ ...
113
+5 -5
--- src/info.c
+++ src/info.c
@@ -453,12 +453,12 @@
453453
DiffConfig *construct_diff_flags(int diffType, DiffConfig *pCfg){
454454
u64 diffFlags = 0; /* Zero means do not show any diff */
455455
if( diffType>0 ){
456456
int x;
457457
if( diffType==2 ) diffFlags = DIFF_SIDEBYSIDE;
458
- if( P_NoSQL("w") ) diffFlags |= DIFF_IGNORE_ALLWS;
459
- if( PD_NoSQL("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
458
+ if( P_AntiSpider("w") ) diffFlags |= DIFF_IGNORE_ALLWS;
459
+ if( PD_AntiSpider("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
460460
diffFlags |= DIFF_STRIP_EOLCR;
461461
diff_config_init(pCfg, diffFlags);
462462
463463
/* "dc" query parameter determines lines of context */
464464
x = atoi(PD("dc","7"));
@@ -1211,12 +1211,12 @@
12111211
pTo = vdiff_parse_manifest("to", &ridTo);
12121212
if( pTo==0 ) return;
12131213
pFrom = vdiff_parse_manifest("from", &ridFrom);
12141214
if( pFrom==0 ) return;
12151215
zGlob = P("glob");
1216
- zFrom = P_NoSQL("from");
1217
- zTo = P_NoSQL("to");
1216
+ zFrom = P_AntiSpider("from");
1217
+ zTo = P_AntiSpider("to");
12181218
if( bInvert ){
12191219
Manifest *pTemp = pTo;
12201220
const char *zTemp = zTo;
12211221
pTo = pFrom;
12221222
pFrom = pTemp;
@@ -1686,11 +1686,11 @@
16861686
dflt = db_get_int("preferred-diff-type",-99);
16871687
if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
16881688
zDflt[0] = dflt + '0';
16891689
zDflt[1] = 0;
16901690
cookie_link_parameter("diff","diff", zDflt);
1691
- return atoi(PD_NoSQL("diff",zDflt));
1691
+ return atoi(PD_AntiSpider("diff",zDflt));
16921692
}
16931693
16941694
16951695
/*
16961696
** WEBPAGE: fdiff
16971697
--- src/info.c
+++ src/info.c
@@ -453,12 +453,12 @@
453 DiffConfig *construct_diff_flags(int diffType, DiffConfig *pCfg){
454 u64 diffFlags = 0; /* Zero means do not show any diff */
455 if( diffType>0 ){
456 int x;
457 if( diffType==2 ) diffFlags = DIFF_SIDEBYSIDE;
458 if( P_NoSQL("w") ) diffFlags |= DIFF_IGNORE_ALLWS;
459 if( PD_NoSQL("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
460 diffFlags |= DIFF_STRIP_EOLCR;
461 diff_config_init(pCfg, diffFlags);
462
463 /* "dc" query parameter determines lines of context */
464 x = atoi(PD("dc","7"));
@@ -1211,12 +1211,12 @@
1211 pTo = vdiff_parse_manifest("to", &ridTo);
1212 if( pTo==0 ) return;
1213 pFrom = vdiff_parse_manifest("from", &ridFrom);
1214 if( pFrom==0 ) return;
1215 zGlob = P("glob");
1216 zFrom = P_NoSQL("from");
1217 zTo = P_NoSQL("to");
1218 if( bInvert ){
1219 Manifest *pTemp = pTo;
1220 const char *zTemp = zTo;
1221 pTo = pFrom;
1222 pFrom = pTemp;
@@ -1686,11 +1686,11 @@
1686 dflt = db_get_int("preferred-diff-type",-99);
1687 if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
1688 zDflt[0] = dflt + '0';
1689 zDflt[1] = 0;
1690 cookie_link_parameter("diff","diff", zDflt);
1691 return atoi(PD_NoSQL("diff",zDflt));
1692 }
1693
1694
1695 /*
1696 ** WEBPAGE: fdiff
1697
--- src/info.c
+++ src/info.c
@@ -453,12 +453,12 @@
453 DiffConfig *construct_diff_flags(int diffType, DiffConfig *pCfg){
454 u64 diffFlags = 0; /* Zero means do not show any diff */
455 if( diffType>0 ){
456 int x;
457 if( diffType==2 ) diffFlags = DIFF_SIDEBYSIDE;
458 if( P_AntiSpider("w") ) diffFlags |= DIFF_IGNORE_ALLWS;
459 if( PD_AntiSpider("noopt",0)!=0 ) diffFlags |= DIFF_NOOPT;
460 diffFlags |= DIFF_STRIP_EOLCR;
461 diff_config_init(pCfg, diffFlags);
462
463 /* "dc" query parameter determines lines of context */
464 x = atoi(PD("dc","7"));
@@ -1211,12 +1211,12 @@
1211 pTo = vdiff_parse_manifest("to", &ridTo);
1212 if( pTo==0 ) return;
1213 pFrom = vdiff_parse_manifest("from", &ridFrom);
1214 if( pFrom==0 ) return;
1215 zGlob = P("glob");
1216 zFrom = P_AntiSpider("from");
1217 zTo = P_AntiSpider("to");
1218 if( bInvert ){
1219 Manifest *pTemp = pTo;
1220 const char *zTemp = zTo;
1221 pTo = pFrom;
1222 pFrom = pTemp;
@@ -1686,11 +1686,11 @@
1686 dflt = db_get_int("preferred-diff-type",-99);
1687 if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
1688 zDflt[0] = dflt + '0';
1689 zDflt[1] = 0;
1690 cookie_link_parameter("diff","diff", zDflt);
1691 return atoi(PD_AntiSpider("diff",zDflt));
1692 }
1693
1694
1695 /*
1696 ** WEBPAGE: fdiff
1697

Keyboard Shortcuts

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