mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Moved ifLabel -> cleanPort and updated the usage (#6288)
* refactor: Moved ifLabel -> cleanPort and updated the usage * added list of tags allowed * few updates as per comments from @murrant * Added simple unit tests * double display for javascript popover * Remove ifNameDescr() function Fix realtime port page * remove accidental temp code * Remove double display calls in ajax tables
This commit is contained in:
@@ -17,7 +17,7 @@ if (defined('SHOW_SETTINGS') || empty($widget_settings)) {
|
||||
<form class="form-horizontal" onsubmit="widget_settings(this); return false;">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
html is supported here. If you want just text then wrap in <pre></pre>
|
||||
The following html tags are supported: <b>, <iframe>, <i>, <ul>, <li>, <h1>, <h2>, <h3>, <h4>, <br>, <p>. If you want just text then wrap in <pre></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -33,5 +33,11 @@ if (defined('SHOW_SETTINGS') || empty($widget_settings)) {
|
||||
</div>
|
||||
</form>';
|
||||
} else {
|
||||
$common_output[] = nl2br(display($widget_settings['notes']));
|
||||
$tmp_config = array(
|
||||
'HTML.Allowed' => 'b,iframe,i,ul,li,h1,h2,h3,h4,br,p',
|
||||
'HTML.Trusted' => true,
|
||||
'HTML.SafeIframe' => true,
|
||||
);
|
||||
$common_output[] = display(nl2br($widget_settings['notes']), $tmp_config);
|
||||
unset($tmp_config);
|
||||
}
|
||||
|
@@ -142,6 +142,7 @@ $(function() {
|
||||
';
|
||||
|
||||
foreach (dbFetchRows($query, $params) as $result) {
|
||||
$result = cleanPort($result);
|
||||
$common_output[] = '
|
||||
<tr>
|
||||
<td class="text-left">'.generate_device_link($result, shorthost($result['hostname'])).'</td>
|
||||
|
Reference in New Issue
Block a user