Skip to content

Commit 2a0be1f

Browse files
authored
Merge pull request #107 from AuditeMarlow/prevent-html-injection
Prevent HTML injection
2 parents 5254315 + 3f335fc commit 2a0be1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tinker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(OutputModifier $outputModifier)
3535
public function execute(string $phpCode): string
3636
{
3737
$phpCode = $this->removeComments($phpCode);
38-
38+
3939
$this->shell->addInput($phpCode);
4040

4141
$closure = new ExecutionLoopClosure($this->shell);
@@ -116,6 +116,6 @@ protected function cleanOutput(string $output): string
116116

117117
$output = preg_replace('/(?s)(<whisper.*?<\/whisper>)|INFO Ctrl\+D\./ms', '$2', $output);
118118

119-
return trim($output);
119+
return htmlentities(trim($output));
120120
}
121121
}

0 commit comments

Comments
 (0)