Changeset 22948
- Timestamp:
- 2010-09-23T15:55:32+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/macros/query.dm
r22876 r22948 613 613 614 614 615 // convert commas and spaces to plus 616 // also convert other illegal characters to %xx codes 615 // convert spaces to plus 616 // also convert other illegal characters (including commas) to %xx codes 617 // This routine used to treat commas like spaces (replacing them with a plus), 618 // but this is no longer good enough for handling sql-queries 617 619 function format(string) \{ 618 620 var str = "" + string; … … 622 624 for (j = 0; j < str.length; j++) \{ 623 625 ch=str.charAt(j); 624 if (ch == " " || ch == ",") \{626 if (ch == " ") \{ 625 627 if (flag == 0) \{ 626 628 out += "+"; … … 629 631 continue; 630 632 \} 631 if (ch == " ;" || ch == ":" || ch == "/" || ch == "?" ||633 if (ch == "," || ch == ";" || ch == ":" || ch == "/" || ch == "?" || 632 634 ch == "@" || ch == "&" || ch == "=" || ch == "#" || 633 635 ch == "%") \{ … … 920 922 <p>For example:<br> 921 923 <i> 922 element in ( 'dc.Keywords') AND value='Farming'<br>923 element in ( 'dls.Title') AND value LIKE 'F%'<br>924 element in ( 'dls.Title') AND value<'F%'<br>924 element in (\'dc.Keywords\') AND value=\'Farming\'<br> 925 element in (\'dls.Title\') AND value LIKE \'F%\'<br> 926 element in (\'dls.Title\') AND value<\'F%\'<br> 925 927 </i> 926 928 ) -
main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp
r22833 r22948 61 61 #include "pingaction.h" 62 62 #include "queryaction.h" 63 #if defined(USE_SQLITE) 64 #include "sqlqueryaction.h" 65 #endif 66 63 67 #include "documentaction.h" 64 68 #include "dynamicclassifieraction.h" … … 346 350 tipaction *atipaction = NULL; 347 351 queryaction *aqueryaction = NULL; 352 #if defined(USE_SQLITE) 353 sqlqueryaction *asqlqueryaction = NULL; 354 #endif 348 355 documentaction *adocumentaction = NULL; 349 356 dynamicclassifieraction *adynamicclassifieraction = NULL; … … 584 591 } 585 592 593 #if defined(USE_SQLITE) 594 if (asqlqueryaction == NULL) { 595 asqlqueryaction = new sqlqueryaction(); 596 asqlqueryaction->set_receptionist (&recpt); 597 recpt.add_action (asqlqueryaction); 598 } 599 #endif 600 586 601 if (adocumentaction == NULL) { 587 602 adocumentaction = new documentaction();
Note:
See TracChangeset
for help on using the changeset viewer.