Changeset 22948 for main/trunk/greenstone2/macros
- Timestamp:
- 2010-09-23T15:55:32+12:00 (14 years ago)
- File:
-
- 1 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 )
Note:
See TracChangeset
for help on using the changeset viewer.