Skip to content

Commit

Permalink
Merge pull request #27 from yast/filter_beep_and_form_feed
Browse files Browse the repository at this point in the history
Filter out beep and form-feed in xml output gh##25
  • Loading branch information
jreidinger committed Jul 2, 2013
2 parents 19b5a82 + f412e48 commit 439cb17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libycp/src/Xmlcode.cc
Expand Up @@ -868,7 +868,7 @@ Xmlcode::xmlify( const string & s )

const char *cptr = s.c_str();
const char *next;
while( (next = strpbrk( cptr, "&<>'\"\n\t" )) ) {
while( (next = strpbrk( cptr, "&<>'\"\n\t\f\v" )) ) {
result += string( cptr, next - cptr );
switch (*next) {
case '&': result += "&amp;"; break;
Expand All @@ -878,6 +878,9 @@ Xmlcode::xmlify( const string & s )
case '\'': result += "&apos;"; break;
case '\n': result += "&#xA;"; break;
case '\t': result += "&#x9;"; break;
case '\f':
case '\v':
break; //skip form-feed and vertical tab, lets ignore other non-xml chars for now and fix it when needed
}
cptr = next + 1;
}
Expand Down

0 comments on commit 439cb17

Please sign in to comment.