|
a/libupnpp/smallut.cpp |
|
b/libupnpp/smallut.cpp |
|
... |
|
... |
521 |
// Escape things that would look like markup
|
521 |
// Escape things that would look like markup
|
522 |
string escapeHtml(const string& in)
|
522 |
string escapeHtml(const string& in)
|
523 |
{
|
523 |
{
|
524 |
string out;
|
524 |
string out;
|
525 |
for (string::size_type pos = 0; pos < in.length(); pos++) {
|
525 |
for (string::size_type pos = 0; pos < in.length(); pos++) {
|
526 |
switch (in.at(pos)) {
|
526 |
switch(in.at(pos)) {
|
527 |
case '<':
|
527 |
case '<': out += "<"; break;
|
528 |
out += "<";
|
528 |
case '>': out += ">"; break;
|
529 |
break;
|
529 |
case '&': out += "&"; break;
|
530 |
case '&':
|
530 |
case '"': out += """; break;
|
531 |
out += "&";
|
531 |
default: out += in.at(pos); break;
|
532 |
break;
|
532 |
}
|
533 |
default:
|
|
|
534 |
out += in.at(pos);
|
|
|
535 |
}
|
|
|
536 |
}
|
533 |
}
|
537 |
return out;
|
534 |
return out;
|
538 |
}
|
535 |
}
|
539 |
|
536 |
|
540 |
string escapeShell(const string& in)
|
537 |
string escapeShell(const string& in)
|