Skip to content

Commit

Permalink
do not strip backslashes from script
Browse files Browse the repository at this point in the history
  • Loading branch information
d12fk committed Nov 4, 2012
1 parent 5ca2a3c commit 5d2c080
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function print_line($matches)
{
try {
$parser = new Parser();
$parser->parse(stripslashes($_POST['script']));
$parser->parse($_POST['script']);

$text_color = 'green';
$text = 'success';
Expand All @@ -53,11 +53,11 @@ function print_line($matches)
print "Script to validate:<br />\n";
print '<table cellpadding="0" style="margin:5px 0px 10px 0px; width:100%; border-spacing:0px; font:13px monospace; border:2px solid #f5f5f5">'."\n";
print preg_replace_callback("/^(.*)(\n|$)/Um", "print_line",
stripslashes(strtr($_POST['script'], array(
strtr($_POST['script'], array(
' ' => '&nbsp;',
"\t" => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
))
));
);
print "</table>\n";

print 'Result: <span style="color:'. $text_color .'; font-weight:bold">' . $text ."</span>\n</div><br />\n\n";
Expand Down

0 comments on commit 5d2c080

Please sign in to comment.