Ein, zwei Fragen hätte ich aber hierzu, wenn ich darf...
Es gibt 2 Dateien (Codestellen), die, so nehme ich an, direkt die Eingaben des Benutzers nehmen, also nicht UTF-8-abhängig reagieren.
In der functions_validate.php git es diese Stelle:
Code: Alles auswählen
function validate_email($email)
{
global $db, $lang;
if ($email != '') {
if (preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-äöü]+\.([a-z0-9\-äöü]+\.)*?[a-z]+$/is', $email)) {
$sql = "SELECT ban_email
FROM " . BANLIST_TABLE;
if ($result = $db->sql_query($sql)) {
if ($row = $db->sql_fetchrow($result)) {
do {
$match_email = str_replace('*', '.*?', $row['ban_email']);
if (preg_match('/^' . $match_email . '$/is', $email)) {
$db->sql_freeresult($result);
return array('error' => true, 'error_msg' => $lang['Email_banned']);
}
} while ($row = $db->sql_fetchrow($result));
}
}
$db->sql_freeresult($result);
$sql = "SELECT user_email
FROM " . USERS_TABLE . "
WHERE user_email = '" . str_replace("\'", "''", $email) . "'";
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrow($result)) {
return array('error' => true, 'error_msg' => $lang['Email_taken']);
}
$db->sql_freeresult($result);
return array('error' => false, 'error_msg' => '');
}
}
return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}
Zum Zweiten in der usercp_register.php hab' ich unseren (mit dir zusammen erarbeiteten :-) ) code drin:
Code: Alles auswählen
if ($board_config['force_realname']) {
if (!empty($HTTP_POST_VARS['username'])) {
if (!preg_match('/[A-Z]/', $username{0})) {
$error = true;
$error_msg = $lang['Wrong_username_ABC'];
}
if (!preg_match('/^[a-zäöüßÄÖÜ -]+$/i', $username)) {
$error = true;
$error_msg = $lang['Wrong_username_123'];
}
}
if (!empty($HTTP_POST_VARS['username_reg'])) {
if (!preg_match('/[A-Z]/', $username_reg{0})) {
$error = true;
$error_msg = $lang['Wrong_username_reg_ABC'];
}
if (!preg_match('/^[a-zäöüßÄÖÜ -]+$/i', $username_reg)) {
$error = true;
$error_msg = $lang['Wrong_username_reg_123'];
}
}
$username = $username . ' ' . $username_reg;
}
In der posting_attachments.php hingegen mußte folgende Stelle in UTF-8 umgewandelt werden:
Code: Alles auswählen
if (!$cryptic) {
$this->attach_filename = html_entity_decode(trim(stripslashes($this->attach_filename)));
$this->attach_filename = delete_extension($this->attach_filename);
$this->attach_filename = str_replace(array(' ', '-'), array('_', '_'), $this->attach_filename);
$this->attach_filename = str_replace('__', '_', $this->attach_filename);
$this->attach_filename = str_replace(array(',', '.', '!', '?', 'ü', 'Ü', 'ö', 'Ö', 'ä', 'Ä', ';', ':', '@', "'", '"', '&'), array('', '', '', '', 'ue', 'ue', 'oe', 'oe', 'ae', 'ae', '', '', '', '', '', 'and'), $this->attach_filename);
$this->attach_filename = str_replace(array('$', 'ß', '>', '<', '§', '%', '=', '/', '(', ')', '#', '*', '+', "\\", '{', '}', '[', ']'), array('dollar', 'ss', 'greater', 'lower', 'paragraph', 'percent', 'equal', '', '', '', '', '', '', '', '', '', '', ''), $this->attach_filename);
$this->attach_filename = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);
$this->attach_filename = rawurlencode($this->attach_filename);
$this->attach_filename = preg_replace("/(%[0-9A-F]{1,2})/i", '', $this->attach_filename);
$this->attach_filename = trim($this->attach_filename);
$new_filename = $this->attach_filename;
if (!$new_filename) {
$u_id = (intval($userdata['user_id']) == ANONYMOUS) ? 0 : intval($userdata['user_id']);
$new_filename = $u_id . '_' . $this->filetime . '.' . $this->extension;
}
do {
$this->attach_filename = $new_filename . '_' . substr(rand(), 0, 3) . '.' . $this->extension;
} while (physical_filename_already_stored($this->attach_filename));
Zu guter Letzt noch die Frage, ob ich search_stopwords.txt und search_synonyms.txt dann auch noch in utf8 umwandeln müßte...?
Vorab schon mal danke für jedweden Hinweis :-)