Ignore:
Timestamp:
2014-02-21T18:46:01+13:00 (10 years ago)
Author:
ak19
Message:

Fixing up URL encoding of cgi args so that phrase searching works again. Tested MGPP, Lucene and SQLite searching. Tested simple search, fielded search, advanced single field and multi-field as well as running a query.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/queryaction.cpp

    r28220 r28841  
    13421342    formattedstring = args["q"];
    13431343    // remove & | ! for simple search,do segmentation if necessary
     1344    // To url-decode the '&', format_querystring() will call unsafe_cgi_arg() first
    13441345    format_querystring (formattedstring, args.getintarg("b"), segment);
    13451346    if (args["ct"]!=0) { // mgpp and lucene - need to add in tag info if appropriate
     
    13581359    if (args["b"]=="1" && args["fqa"]=="1") { // explicit query
    13591360      formattedstring = args["q"];
     1361
     1362      // Replace %22 and %26 with " and & respectively, since these characters have meaning
     1363      // in queries: " are used in phrases and & is used in boolean advanced searches.
     1364      // For form searches below, unsafe_cgi_arg is called in the parse_..._form() functions
     1365
     1366      unsafe_cgi_arg("ALL", formattedstring);
    13601367    }
    13611368    else { // form search
    13621369      if (args["b"]=="0") { // regular form
    1363     parse_reg_query_form(formattedstring, args, segment);
     1370    parse_reg_query_form(formattedstring, args, segment); // will call unsafe_cgi_arg to decode url encoding
    13641371      }
    13651372      else  { // advanced form
    1366     parse_adv_query_form(formattedstring, args, segment);
     1373    parse_adv_query_form(formattedstring, args, segment); // will call unsafe_cgi_arg to decode url encoding
    13671374      }
    13681375      args["q"] = formattedstring;
Note: See TracChangeset for help on using the changeset viewer.