diff --git a/src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterFiglet.php b/src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterFiglet.php index aae99d7dd5..9bf5a132ee 100644 --- a/src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterFiglet.php +++ b/src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterFiglet.php @@ -1,41 +1,43 @@ markupError( pht('Unable to locate the `figlet` binary. Install figlet.')); } - $future = id(new ExecFuture('figlet')) + $font = idx($argv, 'font', 'standard'); + $safe_font = preg_replace('/[^0-9a-zA-Z-_.]/', '', $font); + $future = id(new ExecFuture('figlet -f %s', $safe_font)) ->setTimeout(15) ->write(trim($content, "\n")); list($err, $stdout, $stderr) = $future->resolve(); if ($err) { return $this->markupError( pht( 'Execution of `figlet` failed:', $stderr)); } if ($this->getEngine()->isTextMode()) { return $stdout; } return phutil_tag( 'div', array( 'class' => 'PhabricatorMonospaced remarkup-figlet', ), $stdout); } }