93 |
|
{ |
94 |
|
sout << "Content-Type: text/html\n\n"; |
95 |
|
|
96 |
< |
vector<Person> people; |
96 |
> |
vector<Person> people(1); |
97 |
|
|
98 |
|
for (multimap<string, string>::iterator itor(cgi.lower_bound("sn")); itor |
99 |
|
!= cgi.upper_bound("sn"); ++itor) |
102 |
|
|
103 |
|
for (string::size_type index(0); index < sn.length(); ++index) |
104 |
|
{ |
105 |
+ |
if (sn[index] == '%' && index + 2 < sn.length()) |
106 |
+ |
{ |
107 |
+ |
istringstream code(sn.substr(index + 1, 2)); |
108 |
+ |
unsigned short character; |
109 |
+ |
|
110 |
+ |
code.setf(ios_base::hex, ios_base::basefield); |
111 |
+ |
|
112 |
+ |
code >> character; |
113 |
+ |
|
114 |
+ |
sn.replace(index, 3, 1, character); |
115 |
+ |
} |
116 |
+ |
|
117 |
|
while (!isalnum(sn[index]) && index < sn.length()) |
118 |
|
{ |
119 |
|
sn.erase(index, 1); |
120 |
|
} |
109 |
– |
|
110 |
– |
if (index < sn.length()) sn[index] = tolower(sn[index]); |
121 |
|
} |
122 |
|
|
123 |
|
Person person(sn); |
132 |
|
} |
133 |
|
} |
134 |
|
|
135 |
+ |
if (people.size() > 1) |
136 |
+ |
{ |
137 |
+ |
people.erase(people.begin()); |
138 |
+ |
|
139 |
+ |
sort(people.begin(), people.end()); |
140 |
+ |
|
141 |
+ |
people.erase(unique(people.begin(), people.end()), people.end()); |
142 |
+ |
} |
143 |
+ |
|
144 |
|
sout << "<html><head><title>Hello, " << flush; |
145 |
|
|
146 |
|
output(sout, people); |
162 |
|
|
163 |
|
if (person + 2 == people.end()) |
164 |
|
{ |
165 |
< |
sout << (people.size() > 2 ? "," : "") << " and "; |
165 |
> |
sout << (people.size() > 2 ? "," : "") << " and/or "; |
166 |
|
} |
167 |
|
else if (person + 1 != people.end()) |
168 |
|
{ |