Page MenuHomePhabricator

Enable figlet to render text using custom fonts
ClosedPublic

Authored by erik.fercak on Dec 21 2013, 8:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 7:15 AM
Unknown Object (File)
Wed, Mar 27, 3:19 PM
Unknown Object (File)
Feb 7 2024, 3:50 PM
Unknown Object (File)
Dec 17 2023, 6:37 AM
Unknown Object (File)
Dec 12 2023, 10:35 PM
Unknown Object (File)
Dec 3 2023, 4:54 PM
Unknown Object (File)
Dec 2 2023, 11:50 PM
Unknown Object (File)
Dec 2 2023, 2:17 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rPa70de394e1e2: Enable figlet to render text using custom fonts
Summary

Figlet with more fonts will make Phabricator

    _/    _/      _/    _/_/    _/
 _/_/  _/  _/  _/  _/  _/_/  _/
  _/  _/  _/  _/  _/      _/
 _/  _/  _/  _/  _/    _/  _/_/
_/    _/      _/    _/    _/_/




   _/_/_/  _/_/      _/_/    _/  _/_/    _/_/
  _/    _/    _/  _/    _/  _/_/      _/_/_/_/
 _/    _/    _/  _/    _/  _/        _/
_/    _/    _/    _/_/    _/          _/_/_/



                                  _/
     _/_/_/    _/_/    _/  _/_/        _/_/    _/    _/    _/_/_/
  _/_/      _/_/_/_/  _/_/      _/  _/    _/  _/    _/  _/_/
     _/_/  _/        _/        _/  _/    _/  _/    _/      _/_/
_/_/_/      _/_/_/  _/        _/    _/_/      _/_/_/  _/_/_/
Test Plan

Use figlet in comment with no font/various fonts as argument (e.g. lean, script)
and see preview with no errors.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I'll accept this if we apply sanitization similar to the sanitization in PhabricatorRemarkupBlockInterpreterCowsay. Without sanitization, I'm worried that values like font=/etc/passwd might allow an attacker to gain information about files on the system they should not be able to read.

Ideally, it might be nice to include fonts in resources/figlet/ or similar and then provide -d and whitelist the available values, but I'm not sure what sort of license figlet fonts are available under.

Or we could strip any characters not matching [a-zA-Z0-9-_.] from the argument.

Oh, yeah, that's what I meant by "apply sanitization similar to the sanitization..."

erik.fercak updated this revision to Unknown Object (????).Dec 21 2013, 9:54 PM

Sanitize font.

Or do you prefer to use default font or display an error if the argument contains illegal characters?

Thanks!

src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterFiglet.php
17

Prefer $safe_font by convention.