Page MenuHomePhabricator

Allow concatenating HTML with operator extension
ClosedPublic

Authored by vrana on Oct 18 2013, 3:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 3:31 PM
Unknown Object (File)
Mon, Apr 22, 3:31 PM
Unknown Object (File)
Mon, Apr 22, 3:30 PM
Unknown Object (File)
Wed, Apr 17, 3:15 PM
Unknown Object (File)
Fri, Apr 5, 11:14 PM
Unknown Object (File)
Sat, Mar 30, 8:20 AM
Unknown Object (File)
Thu, Mar 28, 10:26 PM
Unknown Object (File)
Mar 18 2024, 11:27 AM

Details

Summary

This will prevent double escaping.

Test Plan

New test case.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I expect this would be available in PHP 5.7 by default. PHP 5.6 introduces internal operator overloading. Once it is released, users would shout: "Why can't we do the same in the userland?". Developers realize that it's silly to have a language that couldn't be written in itself and allow this also in userland. Well, maybe in PHP 5.8.

It's very comforting to know that we'll be safe from double escaping as soon as PHP 5.8 is released.

src/markup/__tests__/PhutilSafeHTMLTestCase.php
14โ€“20

Maybe these tests should have more < and such in them, to prove that double escaping is actually prevented?

14โ€“20

I guess the fact that getHTMLContent() doesn't fatal is pretty good proof that it worked.

vrana updated this revision to Unknown Object (????).Oct 18 2013, 8:46 PM

Use HTML