Skip to content

Commit

Permalink
Fix bug where hash keys are not properly escaped in uneval.
Browse files Browse the repository at this point in the history
Fix bug where hash keys don't get properly escaped in uneval resulting in code
that fails when an eval or reval attempt is made.
  • Loading branch information
pajamian committed Apr 26, 2012
1 parent 069f95c commit 67cc2df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Vend/Util.pm
Expand Up @@ -655,6 +655,7 @@ sub uneval_it {
} elsif ($r eq 'HASH') { } elsif ($r eq 'HASH') {
$s = "{"; $s = "{";
while (($key, $value) = each %$o) { while (($key, $value) = each %$o) {
$key =~ s/(['\\])/\\$1/g;
$s .= "'$key' => " . uneval_it($value) . ","; $s .= "'$key' => " . uneval_it($value) . ",";
} }
$s .= "}"; $s .= "}";
Expand Down

0 comments on commit 67cc2df

Please sign in to comment.