Skip to content

Commit 6e1379f

Browse files
committed
restrict use of tags in organisation name, and disallow JS
1 parent a9ee6fd commit 6e1379f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

public_html/lists/admin/connect.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ function SaveConfig($item, $value, $editable = 1, $ignore_errors = 0)
245245
# }
246246
//# we only use the image type for the logo
247247
flushLogoCache();
248+
break;
249+
default:
250+
if (isset($configInfo['allowtags'])) { ## allowtags can be set but empty
251+
$value = strip_tags($value,$configInfo['allowtags']);
252+
}
253+
if (isset($configInfo['allowJS']) && !$configInfo['allowJS']) { ## it needs to be set and false
254+
$value = disableJavascript($value);
255+
}
248256
}
249257
//# reset to default if not set, and required
250258
if (empty($configInfo['allowempty']) && empty($value)) {

public_html/lists/admin/defaultconfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
'description' => s('Name of the organisation'),
8989
'type' => 'text',
9090
'allowempty' => true,
91+
'allowtags' => '<b><i><u><strong><em><h1><h2><h3><h4>',
92+
'allowJS' => false,
9193
'category' => 'general',
9294
),
9395
// logo of the organisation

0 commit comments

Comments
 (0)