Skip to content

Commit 1345169

Browse files
committed
encode data when previewing import data on admin import
1 parent 1166e81 commit 1345169

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

public_html/lists/admin/importadmin.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@
127127
// var_dump($values);
128128
$email = clean($values[$emailindex]);
129129
$password = $values[$passwordindex];
130-
$loginname = $values[$loginnameindex];
130+
$loginname = strip_tags($values[$loginnameindex]);
131131
$invalid = 0;
132-
if (!$email) {
132+
if (!$email || !is_email($email)) {
133133
if ($test_input && $show_warnings) {
134134
Warn($GLOBALS['I18N']->get('Record has no email').': '.$c->$line);
135135
}
@@ -163,14 +163,14 @@
163163
foreach ($user_list as $email => $data) {
164164
$email = trim($email);
165165
if (strlen($email) > 4) {
166-
echo "<br/><b>$email</b><br/>";
166+
echo "<br/><b>".htmlspecialchars($email)."</b><br/>";
167167
$html = '';
168-
$html .= $GLOBALS['I18N']->get('password').': '.$data['password'].'</br>';
169-
$html .= $GLOBALS['I18N']->get('login').': '.$data['loginname'].'</br>';
168+
$html .= $GLOBALS['I18N']->get('password').': '.htmlspecialchars($data['password']).'</br>';
169+
$html .= $GLOBALS['I18N']->get('login').': '.htmlspecialchars($data['loginname']).'</br>';
170170
reset($import_attribute);
171171
foreach ($import_attribute as $item) {
172172
if (!empty($data['values'][$item['index']])) {
173-
$html .= $attributes[$item['index']].' -> '.$data['values'][$item['index']].'<br/>';
173+
$html .= htmlspecialchars($attributes[$item['index']]).' -> '.htmlspecialchars($data['values'][$item['index']]).'<br/>';
174174
}
175175
}
176176
if ($html) {

0 commit comments

Comments
 (0)