28 $var = $event->getValue();
29 if ((!is_string($var) && !is_array($var)) || empty($var)) {
45 'elements' =>
'*-applet-button-form-input-textarea-iframe-script-style-embed-object',
46 'deny_attribute' =>
'class, on*, formaction',
47 'hook_tag' =>
'_elgg_htmlawed_tag_post_processor',
49 'schemes' =>
'*:http,https,ftp,news,mailto,rtsp,teamspeak,gopher,mms,callto',
54 $config[
'anti_link_spam'] = [
'/./',
''];
60 if (!is_array($var)) {
64 $callback =
function (&$v, $k, $config_spec) {
65 if (!is_string($v) || empty($v)) {
69 list (
$config, $spec) = $config_spec;
73 array_walk_recursive($var, $callback, [
$config, $spec]);
95 'color',
'cursor',
'text-align',
'vertical-align',
'font-size',
96 'font-weight',
'font-style',
'border',
'border-top',
'background-color',
97 'border-bottom',
'border-left',
'border-right',
98 'margin',
'margin-top',
'margin-bottom',
'margin-left',
99 'margin-right',
'padding',
'float',
'text-decoration',
102 $allowed_styles =
elgg_trigger_event_results(
'allowed_styles',
'htmlawed', [
'tag' => $event->getParam(
'tag')], $allowed_styles);
104 $styles = explode(
';',
$style);
107 foreach ($styles as
$style) {
108 if (!
trim($style) || !str_contains($style,
':')) {
112 list($style_attr, $style_value) = explode(
':',
trim($style));
113 $style_attr =
trim($style_attr);
114 $style_value =
trim($style_value);
116 if (in_array($style_attr, $allowed_styles)) {
117 $style_str .=
"{$style_attr}: {$style_value}; ";
121 if (empty($style_str)) {
elgg_in_context(string $context)
Check if this context exists anywhere in the stack.
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$config
Advanced site settings, debugging section.
function filter(array, term)
$attributes
Elgg AJAX loader.
Models an event passed to event handlers.