1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00
phorge-phorge/externals
epriestley fc4cb57357 Fix JSON encoding of PhutilSafeHTML for browser consumption
Summary:
If you run this code:

  json_encode(array('tag' => phutil_tag('div', array())));

...you get this result, because json_encode() does not call toString() on objects:

  {"tag":{}}

Instead, convert such objects to their underlying strings. Javelin has support for JX.HTML and for implicit conversion (which is kind of sketchy for other reasons) but it's sort of complicated (only happens on Ajax, not behaviors) and messy (not metadata-based), so ignore it for now.

We'll need to do something similar for serialization to the database. My plan there is just to throw on any objects. The only time we put HTML in the database is cache-related and those tiny number of callsites can manually handle it.

Test Plan: Various ajax things now receive the correct data.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4684
2013-01-28 18:11:27 -08:00
..
amazon-ses Use exceptions for S3 error messages 2011-08-04 14:17:13 -07:00
javelinjs Fix JSON encoding of PhutilSafeHTML for browser consumption 2013-01-28 18:11:27 -08:00
mimemailparser Skip attaching 'inline' text attachments 2011-06-12 22:38:57 -07:00
phpmailer Fix EncodeQ implementation in PHPMailer, and provide SSL/TLS options 2012-12-20 11:11:15 -08:00
raphael Minor, don't minify raphael.js since it doesn't survive it 2012-04-02 12:09:04 -07:00
recaptcha PhabricatorEnv 2011-01-31 11:55:26 -08:00
s3 Add an Amazon S3 storage engine for Phabricator 2011-08-03 10:58:03 -07:00
skins/oblivious one more phame tweak for better social sharing -- make sure $uri is the full uri 2012-12-21 13:46:23 -08:00
stripe-js For discussion -- Stripe integration 2012-04-04 16:09:29 -07:00
stripe-php For discussion -- Stripe integration 2012-04-04 16:09:29 -07:00
vegas Aphlict, simple notification server 2011-05-17 10:32:41 -07:00
xhprof Fix some issues caught by HipHop, and work around some issues 2011-02-26 21:01:42 -08:00