Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.4
|
<?php /** * MyBB 1.4
|
* Copyright � 2008 MyBB Group, All Rights Reserved
| * Copyright © 2008 MyBB Group, All Rights Reserved
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: user.php 4338 2009-04-03 23:26:21Z Tikitiki $
| * $Id: user.php 4384 2009-06-19 11:49:42Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 70 | Zeile 70 |
---|
// Fix bad characters $username = trim($username);
|
// Fix bad characters $username = trim($username);
|
$username = str_replace(array(unicode_chr(160), unicode_chr(173), unicode_chr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237)), array(" ", "-", "", "", ""), $username);
| $username = str_replace(array(unicode_chr(160), unicode_chr(173), unicode_chr(0xCA), dec_to_utf8(8238), dec_to_utf8(8237), dec_to_utf8(8203)), array(" ", "-", "", "", "", ""), $username);
|
// Remove multiple spaces from the username $username = preg_replace("#\s{2,}#", " ", $username);
| // Remove multiple spaces from the username $username = preg_replace("#\s{2,}#", " ", $username);
|
Zeile 220 | Zeile 220 |
---|
$user = &$this->data; return true; }
|
$user = &$this->data; return true; }
|
|
|
/** * Verifies if an email address is valid or not. *
| /** * Verifies if an email address is valid or not. *
|
Zeile 235 | Zeile 236 |
---|
if(trim($user['email']) == '') { $this->set_error('missing_email');
|
if(trim($user['email']) == '') { $this->set_error('missing_email');
|
return false; }
| return false; }
|
// Check if this is a proper email address. if(!validate_email_format($user['email']))
| // Check if this is a proper email address. if(!validate_email_format($user['email']))
|
Zeile 267 | Zeile 268 |
---|
if(isset($user['email2']) && $user['email'] != $user['email2']) { $this->set_error("emails_dont_match");
|
if(isset($user['email2']) && $user['email'] != $user['email2']) { $this->set_error("emails_dont_match");
|
return false; } }
/**
| return false; } }
/**
|
* Verifies if a website is valid or not. * * @return boolean True when valid, false when invalid.
| * Verifies if a website is valid or not. * * @return boolean True when valid, false when invalid.
|
Zeile 324 | Zeile 325 |
---|
$msn = &$this->data['msn'];
if($msn != '' && validate_email_format($msn) == false)
|
$msn = &$this->data['msn'];
if($msn != '' && validate_email_format($msn) == false)
|
{
| {
|
$this->set_error("invalid_msn_address"); return false; } return true; }
|
$this->set_error("invalid_msn_address"); return false; } return true; }
|
|
|
/** * Verifies if a birthday is valid or not. *
| /** * Verifies if a birthday is valid or not. *
|
Zeile 339 | Zeile 340 |
---|
function verify_birthday() { global $mybb;
|
function verify_birthday() { global $mybb;
|
|
|
$user = &$this->data; $birthday = &$user['birthday'];
|
$user = &$this->data; $birthday = &$user['birthday'];
|
|
|
if(!is_array($birthday)) { return true; }
|
if(!is_array($birthday)) { return true; }
|
|
|
// Sanitize any input we have $birthday['day'] = intval($birthday['day']); $birthday['month'] = intval($birthday['month']); $birthday['year'] = intval($birthday['year']);
// Error if a day and month exists, and the birthday day and range is not in range
|
// Sanitize any input we have $birthday['day'] = intval($birthday['day']); $birthday['month'] = intval($birthday['month']); $birthday['year'] = intval($birthday['year']);
// Error if a day and month exists, and the birthday day and range is not in range
|
if($birthday['day'] && $birthday['month'])
| if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29))
|
{
|
{
|
if($birthday['day'] < 1 || $birthday['day'] > 31 || $birthday['month'] < 1 || $birthday['month'] > 12 || ($birthday['month'] == 2 && $birthday['day'] > 29)) { $this->set_error("invalid_birthday"); return false; }
| $this->set_error("invalid_birthday"); return false; }
|
|
|
// Check if the day actually exists. $months = get_bdays($birthday['year']); if($birthday['day'] > $months[$birthday['month']-1]) { $this->set_error("invalid_birthday"); return false; }
| // Check if the day actually exists. $months = get_bdays($birthday['year']); if($birthday['day'] > $months[$birthday['month']-1]) { $this->set_error("invalid_birthday"); return false;
|
}
// Error if a year exists and the year is out of range
| }
// Error if a year exists and the year is out of range
|