Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Escape exec() inputs and set locale before replacing
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Jan 3, 2017
1 parent 552e4ae commit 043db72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Gin/Foundation/Console/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ public function askForConfirmation()
*/
protected function rename()
{
setlocale(LC_CTYPE, "en_US.UTF-8");

foreach ($this->answers as $key => $answer) {
$this->findAndReplaceInDir('./', "{{ {$key} }}", $answer);
$this->findAndReplaceInDir(
'./',
"{{ {$key} }}",
escapeshellcmd($answer)
);
}

$this->getOutput()->writeln('<fg=green>Theme successufully initialized. Cheers!</>');
Expand Down

0 comments on commit 043db72

Please sign in to comment.