Skip to content

Commit 42cfa6e

Browse files
author
Till Brehm
committed
Added internal htmlentities function with array support and ENT_QUOTES.
1 parent 6a0796e commit 42cfa6e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

interface/lib/classes/functions.inc.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,25 @@ public function generate_ssh_key($client_id, $username = ''){
454454
$app->log("Failed to create SSH keypair for ".$username, LOGLEVEL_WARN);
455455
}
456456
}
457+
458+
public function htmlentities($value) {
459+
global $conf;
460+
461+
if(is_array($value)) {
462+
$out = array();
463+
foreach($values as $key => $val) {
464+
if(is_array($val)) {
465+
$out[$key] = $this->htmlentities($val);
466+
} else {
467+
$out[$key] = htmlentities($val, ENT_QUOTES, $conf["html_content_encoding"]);
468+
}
469+
}
470+
} else {
471+
$out = htmlentities($value, ENT_QUOTES, $conf["html_content_encoding"]);
472+
}
473+
474+
return $out;
475+
}
457476
}
458477

459478
?>

0 commit comments

Comments
 (0)