fixed 'not well-formed...' error caused my ESP chararater passed to XMLin function
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4330 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
cc05e2710c
commit
cdeb9db913
@ -161,7 +161,17 @@ sub submit_request {
|
||||
while (<$client>) {
|
||||
$response .= $_;
|
||||
if (m/<\/xcatresponse>/) {
|
||||
#replace ESC with xxxxESCxxx because XMLin cannot handle it
|
||||
$response =~ s/\e/xxxxESCxxxx/g;
|
||||
|
||||
$rsp = XMLin($response,SuppressEmpty=>undef,ForceArray=>1);
|
||||
|
||||
#add ESC back
|
||||
foreach my $key (keys %$rsp) {
|
||||
if (ref($rsp->{$key}) eq 'ARRAY') { foreach my $text (@{$rsp->{$key}}) { $text =~ s/xxxxESCxxxx/\e/g; } }
|
||||
else { $rsp->{$key} =~ s/xxxxESCxxxx/\r/g; }
|
||||
}
|
||||
|
||||
$response='';
|
||||
$callback->($rsp);
|
||||
if ($rsp->{serverdone}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user