Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/response/AphrontResponse.php
Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | /* -( Metadata )----------------------------------------------------------- */ | ||||
public static function processValueForJSONEncoding(&$value, $key) { | public static function processValueForJSONEncoding(&$value, $key) { | ||||
if ($value instanceof PhutilSafeHTMLProducerInterface) { | if ($value instanceof PhutilSafeHTMLProducerInterface) { | ||||
// This renders the producer down to PhutilSafeHTML, which will then | // This renders the producer down to PhutilSafeHTML, which will then | ||||
// be simplified into a string below. | // be simplified into a string below. | ||||
$value = hsprintf('%s', $value); | $value = hsprintf('%s', $value); | ||||
} | } | ||||
if ($value instanceof PhutilSafeHTML) { | if ($value instanceof PhutilSafeHTML) { | ||||
// TODO: Javelin supports implicity conversion of '__html' objects to | // TODO: Javelin supports implicit conversion of '__html' objects to | ||||
// JX.HTML, but only for Ajax responses, not behaviors. Just leave things | // JX.HTML, but only for Ajax responses, not behaviors. Just leave things | ||||
// as they are for now (where behaviors treat responses as HTML or plain | // as they are for now (where behaviors treat responses as HTML or plain | ||||
// text at their discretion). | // text at their discretion). | ||||
$value = $value->getHTMLContent(); | $value = $value->getHTMLContent(); | ||||
} | } | ||||
} | } | ||||
public static function encodeJSONForHTTPResponse(array $object) { | public static function encodeJSONForHTTPResponse(array $object) { | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0