changed email validation, special characters do not need to be escaped within character class (added ampersand to email validation too)


git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3525 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-02-25 16:03:22 +00:00
parent 06a38909e6
commit fa16e21fd4
8 changed files with 40 additions and 36 deletions

View file

@ -200,7 +200,7 @@ function auth($type, $forum_id, $userdata, $f_access = '')
{ {
case AUTH_ALL: case AUTH_ALL:
$auth_user[$key] = TRUE; $auth_user[$key] = TRUE;
$auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users'];
break; break;
case AUTH_REG: case AUTH_REG:
@ -239,7 +239,7 @@ function auth($type, $forum_id, $userdata, $f_access = '')
{ {
case AUTH_ALL: case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE; $auth_user[$f_forum_id][$key] = TRUE;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Anonymous_users']; $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Anonymous_Users'];
break; break;
case AUTH_REG: case AUTH_REG:

View file

@ -748,7 +748,11 @@ function smilies_pass($message)
} }
$smilies = $db->sql_fetchrowset($result); $smilies = $db->sql_fetchrowset($result);
if (count($smilies))
{
usort($smilies, 'smiley_sort'); usort($smilies, 'smiley_sort');
}
for ($i = 0; $i < count($smilies); $i++) for ($i = 0; $i < count($smilies); $i++)
{ {
$orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/"; $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
@ -761,6 +765,7 @@ function smilies_pass($message)
$message = preg_replace($orig, $repl, ' ' . $message . ' '); $message = preg_replace($orig, $repl, ' ' . $message . ' ');
$message = substr($message, 1, -1); $message = substr($message, 1, -1);
} }
return $message; return $message;
} }
@ -774,5 +779,4 @@ function smiley_sort($a, $b)
return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1; return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
} }
?> ?>

View file

@ -117,7 +117,7 @@ function validate_email($email)
if ($email != '') if ($email != '')
{ {
if (preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email)) if (preg_match('/^[a-z0-9&.-_+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email))
{ {
$sql = "SELECT ban_email $sql = "SELECT ban_email
FROM " . BANLIST_TABLE; FROM " . BANLIST_TABLE;

View file

@ -99,7 +99,7 @@ function page_common_form($hidden, $submit)
?> ?>
<tr> <tr>
<td class="catbottom" align="center" colspan="2"><?php echo $hidden; ?><input class="mainoption" type="submit" value="<?php echo $submit; ?>" /></td> <td class="catBottom" align="center" colspan="2"><?php echo $hidden; ?><input class="mainoption" type="submit" value="<?php echo $submit; ?>" /></td>
</tr> </tr>
<?php <?php
@ -111,10 +111,10 @@ function page_upgrade_form()
?> ?>
<tr> <tr>
<td class="catbottom" align="center" colspan="2"><?php echo $lang['continue_upgrade']; ?></td> <td class="catBottom" align="center" colspan="2"><?php echo $lang['continue_upgrade']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="catbottom" align="center" colspan="2"><input type="submit" name="upgrade_now" value="<?php echo $lang['upgrade_submit']; ?>" /></td> <td class="catBottom" align="center" colspan="2"><input type="submit" name="upgrade_now" value="<?php echo $lang['upgrade_submit']; ?>" /></td>
</tr> </tr>
<?php <?php

View file

@ -1146,7 +1146,7 @@ switch( $mode )
} }
$template->assign_vars(array( $template->assign_vars(array(
'PAGINATION' => generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id", $forum_topics, $board_config['topics_per_page'], $start), 'PAGINATION' => generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id'], $forum_topics, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )), 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )),
'L_GOTO_PAGE' => $lang['Goto_page']) 'L_GOTO_PAGE' => $lang['Goto_page'])
); );

View file

@ -8,6 +8,6 @@
<th class="thHead" align="center">{L_USER_SELECT}</th> <th class="thHead" align="center">{L_USER_SELECT}</th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><input class="post" type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></td> <td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -32,7 +32,7 @@
</tr> </tr>
<!-- END memberrow --> <!-- END memberrow -->
<tr> <tr>
<td class="catbottom" colspan="8" height="28">&nbsp;</td> <td class="catBottom" colspan="8" height="28">&nbsp;</td>
</tr> </tr>
</table> </table>
<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">

View file

@ -615,7 +615,7 @@ if ( $can_watch_topic )
// If we've got a hightlight set pass it on to pagination, // If we've got a hightlight set pass it on to pagination,
// I get annoyed when I lose my highlight after the first page. // I get annoyed when I lose my highlight after the first page.
// //
$pagination = ( $highlight_active ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start); $pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
// //
// Send vars to template // Send vars to template