Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102330041
PhutilSafeHTML.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 19, 14:29
Size
714 B
Mime Type
text/x-php
Expires
Fri, Feb 21, 14:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24332209
Attached To
rPHU libphutil
PhutilSafeHTML.php
View Options
<?php
final
class
PhutilSafeHTML
{
private
$content
;
public
function
__construct
(
$content
)
{
$this
->
content
=
(
string
)
$content
;
}
public
function
__toString
()
{
return
$this
->
getHTMLContent
();
}
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
));
}
}
Event Timeline
Log In to Comment