Commit 24870347 authored by Dries's avatar Dries

- Patch #76588 by kbahey and RobRoy: made the syslog deamon strip HTML tags.

parent e9ffe24f
......@@ -544,7 +544,7 @@ function contact_mail_page_submit($form_id, $form_values) {
// Log the operation:
flood_register_event('contact');
watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $form_values['name'] ." <$from>", '%category' => $contact->category));
watchdog('mail', '%name-from sent an e-mail regarding %category.', array('%name-from' => $form_values['name'] ." [$from]", '%category' => $contact->category));
// Update user:
drupal_set_message(t('Your message has been sent.'));
......
......@@ -88,18 +88,15 @@ function syslog_theme() {
function theme_syslog_format($entry) {
global $base_url;
$message = t('@base_url|@timestamp|@type|@uid|@ip|@request_uri|@referer_uri|@link|@message',
array(
'@base_url' => $base_url,
'@timestamp' => $entry['timestamp'],
'@type' => $entry['type'],
'@ip' => $entry['ip'],
'@request_uri' => $entry['request_uri'],
'@referer_uri' => $entry['referer'],
'@uid' => $entry['user']->uid,
'@link' => strip_tags($entry['link']),
// Keep message English, but replace variable components, if present.
'@message' => strip_tags(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables'])),
));
$message = $base_url;
$message .= '|' . $entry['timestamp'];
$message .= '|' . $entry['type'];
$message .= '|' . $entry['ip'];
$message .= '|' . $entry['request_uri'];
$message .= '|' . $entry['referer'];
$message .= '|' . $entry['user']->uid;
$message .= '|' . strip_tags($entry['link']);
$message .= '|' . strip_tags(is_null($entry['variables']) ? $entry['message'] : strtr($entry['message'], $entry['variables']));
return $message;
}
......@@ -1367,7 +1367,7 @@ function user_register_submit($form_id, $form_values) {
$merge_data['status'] = variable_get('user_register', 1) == 1;
}
$account = user_save('', array_merge($form_values, $merge_data));
watchdog('user', 'New user: %name %email.', array('%name' => $name, '%email' => '<'. $mail .'>'), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit'));
watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit'));
$variables = array('!username' => $name, '!site' => variable_get('site_name', 'Drupal'), '!password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen('http://')), '!mailto' => $mail, '!date' => format_date(time()), '!login_uri' => url('user', array('absolute' => TRUE)), '!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE)), '!login_url' => user_pass_reset_url($account));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment