Changeset View
Changeset View
Standalone View
Standalone View
src/markup/PhutilSafeHTML.php
Show All 24 Lines | final class PhutilSafeHTML { | ||||
public static function applyFunction($function, $string /* , ... */) { | public static function applyFunction($function, $string /* , ... */) { | ||||
$args = func_get_args(); | $args = func_get_args(); | ||||
array_shift($args); | array_shift($args); | ||||
$args = array_map('phutil_escape_html', $args); | $args = array_map('phutil_escape_html', $args); | ||||
return new PhutilSafeHTML(call_user_func_array($function, $args)); | return new PhutilSafeHTML(call_user_func_array($function, $args)); | ||||
} | } | ||||
// Requires http://pecl.php.net/operator. | |||||
public function __concat($html) { | |||||
$clone = clone $this; | |||||
return $clone->appendHTML($html); | |||||
} | |||||
public function __assign_concat($html) { | |||||
return $this->appendHTML($html); | |||||
} | |||||
} | } |