HomePhabricator

Introduce tsprintf(), for escaping terminal output

Description

Introduce tsprintf(), for escaping terminal output

Summary:
Ref T8243. User-controlled strings like task and revision titles may contain terminal control codes which can make text bold and colorful when they shouldn't be at a minimum, and possibly do some worse things in some terminals.

Add tsprintf() for escaping these sorts of strings in order to show them to human viewers.

Test Plan: Added and executed unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: joshuaspence, epriestley

Maniphest Tasks: T8243

Differential Revision: https://secure.phabricator.com/D12966

Details

Provenance
epriestleyAuthored on
epriestleyPushed on May 24 2015, 1:37 PM
Reviewer
btrahan
Differential Revision
D12966: Introduce tsprintf(), for escaping terminal output
Parents
rPHU48bfe08e5fac: Don't call pht() from generate_nodes.php
Branches
Unknown
Tags
Unknown
Tasks
T8243: Escape console output more thoroughly