mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-18 22:58:10 +01:00
- allow login with redirect parameter
- altered URL regular expression so it won't cause problem with long URLs - PCRE >:( [Bug #6720] - moderator list on index should have coloured groups in bold as everywhere else too - correctly handle password requirements in UCP [Bug #6692] - added soft-hyphen to utf8_clean_string(), if you know any more evil characters (or whitespace characters that are not in ASCII range) then tell me about them (bug report) ;-) git-svn-id: file:///svn/phpbb/trunk@6832 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
732ad23cd7
commit
17a27175fd
@ -46,13 +46,14 @@ $sub_delims = '!$&\'()*+,;=';
|
||||
$pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
|
||||
|
||||
$scheme = '[a-z][a-z\d+\-.]*';
|
||||
$reg_name = "(?:[$unreserved$sub_delims|]+|$pct_encoded)+"; // rfc: * instead of + and no "|"
|
||||
$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
|
||||
$reg_name = "(?:[$unreserved$sub_delims|@]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" (included instead of userinfo
|
||||
//$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
|
||||
$ipv4_simple = '[0-9.]+';
|
||||
$ipv6_simple = '\[[a-z0-9.:]+\]';
|
||||
$host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
|
||||
$port = '\d*';
|
||||
$authority = "(?:$userinfo@)?$host(?::$port)?";
|
||||
//$authority = "(?:$userinfo@)?$host(?::$port)?";
|
||||
$authority = "$host(?::$port)?";
|
||||
$segment = "$pchar*";
|
||||
$path_abempty = "(?:/$segment)*";
|
||||
$hier_part = "/{2}$authority$path_abempty";
|
||||
|
@ -3023,11 +3023,11 @@ function get_preg_expression($mode)
|
||||
|
||||
case 'url':
|
||||
// generated with regex generation file in the develop folder
|
||||
return "[a-z][a-z\d+\-.]*:/{2}(?:(?:(?:[a-z0-9\-._~!$&'()*+,;=:]+|%[\dA-F]{2}))*@)?(?:(?:[a-z0-9\-._~!$&'()*+,;=|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
|
||||
return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
|
||||
break;
|
||||
|
||||
case 'www_url':
|
||||
return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
|
||||
return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
|
||||
break;
|
||||
|
||||
case 'relative_url':
|
||||
|
@ -598,7 +598,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
||||
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';font-weight:bold;"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -210,8 +210,7 @@ class ucp_profile
|
||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
||||
}
|
||||
|
||||
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
|
||||
$pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL');
|
||||
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS', '[\x01-\x7F]+' => 'USERNAME_ASCII');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
@ -223,7 +222,7 @@ class ucp_profile
|
||||
'CUR_PASSWORD' => '',
|
||||
|
||||
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
||||
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||
|
||||
'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $user->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false,
|
||||
'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
|
||||
|
@ -1092,22 +1092,26 @@ function utf8_clean_string($text)
|
||||
|
||||
static $homographs = array(
|
||||
// cyrllic
|
||||
"\xD0\xB0" => "\x61",
|
||||
"\xD0\xB5" => "\x65",
|
||||
"\xD0\xBE" => "\x6F",
|
||||
"\xD1\x80" => "\x70",
|
||||
"\xD1\x81" => "\x63",
|
||||
"\xD1\x83" => "\x79",
|
||||
"\xD1\x85" => "\x78",
|
||||
"\xD1\x95" => "\x73",
|
||||
"\xD1\x96" => "\x69",
|
||||
"\xD1\x98" => "\x6A",
|
||||
"\xD2\xBB" => "\x68",
|
||||
"\xD0\xB0" => "\x61",
|
||||
"\xD0\xB5" => "\x65",
|
||||
"\xD0\xBE" => "\x6F",
|
||||
"\xD1\x80" => "\x70",
|
||||
"\xD1\x81" => "\x63",
|
||||
"\xD1\x83" => "\x79",
|
||||
"\xD1\x85" => "\x78",
|
||||
"\xD1\x95" => "\x73",
|
||||
"\xD1\x96" => "\x69",
|
||||
"\xD1\x98" => "\x6A",
|
||||
"\xD2\xBB" => "\x68",
|
||||
// greek
|
||||
"\xCE\xB1" => "\x61",
|
||||
"\xCE\xBF" => "\x6F",
|
||||
"\xCE\xB1" => "\x61",
|
||||
"\xCE\xBF" => "\x6F",
|
||||
// other
|
||||
"\xC2\xA1" => "\x69",
|
||||
"\xC2\xA1" => "\x69",
|
||||
"\xC2\xAD" => '',
|
||||
"\x08" => '',
|
||||
"\x09" => "\x32",
|
||||
"\x11" => "\x32",
|
||||
);
|
||||
|
||||
$text = strtr($text, $homographs);
|
||||
|
@ -78,7 +78,7 @@ switch ($mode)
|
||||
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||
}
|
||||
|
||||
login_box("index.$phpEx");
|
||||
login_box(request_var('redirect', "index.$phpEx"));
|
||||
break;
|
||||
|
||||
case 'logout':
|
||||
|
Loading…
x
Reference in New Issue
Block a user