Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14399836
PhutilSafeHTML.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
955 B
Referenced Files
None
Subscribers
None
PhutilSafeHTML.php
View Options
<?php
final
class
PhutilSafeHTML
extends
Phobject
{
private
$content
;
public
function
__construct
(
$content
)
{
$this
->
content
=
(
string
)
$content
;
}
public
function
__toString
()
{
return
$this
->
content
;
}
public
function
getHTMLContent
()
{
return
$this
->
content
;
}
public
function
appendHTML
(
$html
/* , ... */
)
{
foreach
(
func_get_args
()
as
$html
)
{
$this
->
content
.=
phutil_escape_html
(
$html
);
}
return
$this
;
}
public
static
function
applyFunction
(
$function
,
$string
/* , ... */
)
{
$args
=
func_get_args
();
array_shift
(
$args
);
$args
=
array_map
(
'phutil_escape_html'
,
$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
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Dec 24, 5:57 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6901282
Default Alt Text
PhutilSafeHTML.php (955 B)
Attached To
Mode
rPHU libphutil
Attached
Detach File
Event Timeline
Log In to Comment