- Timestamp:
- 2014-03-14T22:46:25+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/phindaction.cpp
r22984 r28899 152 152 153 153 unsigned long count_l, count_e, count_d; 154 unsigned long phrase = args["ppnum"].getulong(); 154 unsigned long phrase = args["ppnum"].getulong(); // needn't encodeFor<web> on vars which have getulong() applied 155 155 text_t &word = args["pptext"]; 156 156 unsigned long first_e = args["pfe"].getulong(); … … 208 208 209 209 if (result.empty()) { 210 output_error("phindaction: The search term ("+ word+") does not occur in the collection",210 output_error("phindaction: The search term ("+encodeForHTML(word)+") does not occur in the collection", 211 211 textout, outconvert, disp, logout, XMLmode); 212 212 return true; … … 255 255 if (XMLmode) { 256 256 textout << "<phinddata id=\"" << phrase 257 << "\" text=\"" << word257 << "\" text=\"" << encodeForHTMLAttr(word) 258 258 << "\" tf=\"" << tf 259 259 << "\" ef=\"" << ef … … 262 262 << "\">\n"; 263 263 } else { 264 textout << "<html><head><title>" << word<< "</title></head>\n"264 textout << "<html><head><title>" << encodeForHTML(word) << "</title></head>\n" 265 265 << "<body><center>\n" 266 << "<p><h1>" << word<< "</h1>\n"267 << "<p><b>"<< word<< "</b> occurs "266 << "<p><h1>" << encodeForHTML(word) << "</h1>\n" 267 << "<p><b>"<< encodeForHTML(word) << "</b> occurs " 268 268 << tf << " times in " << df << " documents\n"; 269 269 } … … 316 316 textout << outconvert << disp 317 317 << "<br><a href=\"_gwcgi_?" 318 << "c=" << args["c"]318 << "c=" << encodeForURL(args["c"]) 319 319 << "&ppnum=" << phrase 320 320 << "&pfe=" << first_e … … 328 328 textout << outconvert << disp 329 329 << "<br><a href=\"_gwcgi_?" 330 << "c=" << args["c"]330 << "c=" << encodeForURL(args["c"]) 331 331 << "&ppnum=" << phrase 332 332 << "&pfe=" << first_e … … 379 379 textout << outconvert << disp 380 380 << "<br><a href=\"_gwcgi_?" 381 << "c=" << args["c"]381 << "c=" << encodeForURL(args["c"]) 382 382 << "&ppnum=" << phrase 383 383 << "&pfe=" << first_e … … 391 391 textout << outconvert << disp 392 392 << "<br><a href=\"_gwcgi_?" 393 << "c=" << args["c"]393 << "c=" << encodeForURL(args["c"]) 394 394 << "&ppnum=" << phrase 395 395 << "&pfe=" << first_e … … 453 453 textout << outconvert << disp 454 454 << "<br><a href=\"_gwcgi_?" 455 << "c=" << args["c"]455 << "c=" << encodeForURL(args["c"]) 456 456 << "&ppnum=" << phrase 457 457 << "&pfe=" << first_e … … 465 465 textout << outconvert << disp 466 466 << "<br><a href=\"_gwcgi_?" 467 << "c=" << args["c"]467 << "c=" << encodeForURL(args["c"]) 468 468 << "&ppnum=" << phrase 469 469 << "&pfe=" << first_e … … 742 742 textout << "<tr valign=top><td>" << type << "</td><td>"; 743 743 textout << outconvert << disp 744 << "<a href=\"_gwcgi_?c=" << collection;744 << "<a href=\"_gwcgi_?c=" << encodeForURL(collection); 745 745 textout << "&ppnum=" << phrase << "\">" << text << "</a>" 746 746 << "</td><td>" << tf << "</td><td>" << df << "</td></tr>\n"; … … 847 847 << "\" df=\"" << df; 848 848 if (!prefix.empty()) { 849 textout << "\" prefix=\"" << prefix; 849 text_t prefix_txt; 850 fromUCArray(prefix, prefix_txt); 851 textout << "\" prefix=\"" << encodeForHTMLAttr(prefix_txt); 850 852 } 851 853 if (!suffix.empty()) { 852 textout << "\" suffix=\"" << suffix; 854 text_t suffix_txt; 855 fromUCArray(suffix, suffix_txt); 856 textout << "\" suffix=\"" << encodeForHTMLAttr(suffix_txt); 853 857 } 854 858 textout << "\"/>\n"; … … 856 860 textout << outconvert << disp 857 861 << "<tr valign=top><td align=right><a href=\"_gwcgi_?" 858 << "c=" << collection<< "&ppnum=" << phrase << "\">";862 << "c=" << encodeForURL(collection) << "&ppnum=" << phrase << "\">"; 859 863 textout << prefix << "</a></td>"; 860 864 textout <<outconvert << disp 861 865 << "<td align=center><a href=\"_gwcgi_?" 862 << "c=" << collection<< "&ppnum=" << phrase << "\">"863 << body<< "</a></td>"866 << "c=" << encodeForURL(collection) << "&ppnum=" << phrase << "\">" 867 << encodeForHTML(body) << "</a></td>" 864 868 << "<td align=left><a href=\"_gwcgi_?" 865 << "c=" << collection<< "&ppnum=" << phrase << "\">";869 << "c=" << encodeForURL(collection) << "&ppnum=" << phrase << "\">"; 866 870 textout << suffix << "</a></td>" 867 871 << "<td>" << tf << "</td><td>" << df << "</td></tr>\n"; … … 986 990 textout << outconvert << disp 987 991 << "<tr valign=top><td><a href=\"_gwcgi_?" 988 << "c=" << collection;992 << "c=" << encodeForURL(collection); 989 993 textout << "&a=d&d=" << hash << "\">" << title << "</a>" 990 994 << "</td><td>" << freq << "</td></tr>\n"; … … 1057 1061 } 1058 1062 1063 void phindaction::fromUCArray(const UCArray &arrin, text_t &txtout) { 1064 txtout.clear(); 1065 if (txtout.capacity() < arrin.size() + 1) { 1066 txtout.reserve(arrin.size() + 1); 1067 } 1068 vector<unsigned char>::const_iterator here = arrin.begin(); 1069 vector<unsigned char>::const_iterator end = arrin.end(); 1070 while (here != end) { 1071 txtout.push_back(*here); // don't need to cast unsigned char to unsigned short 1072 ++here; 1073 } 1074 } 1075 1076 1059 1077 void phindaction::output_error (const text_t &message, ostream &textout, 1060 1078 outconvertclass &outconvert,
Note:
See TracChangeset
for help on using the changeset viewer.