mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-12 11:40:26 +01:00
What did you expect? Us slacking off because of a few digg/heise trolls? nah. never!
The show must go on :) git-svn-id: file:///svn/phpbb/trunk@8280 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ca87f7a2d1
commit
3ca0a7cb76
@ -53,6 +53,7 @@
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#v300">Changes since 3.0.0</a></li>
|
||||
<li><a href="#v30rc8">Changes since RC-8</a></li>
|
||||
<li><a href="#v30rc7">Changes since RC-7</a></li>
|
||||
<li><a href="#v30rc6">Changes since RC-6</a></li>
|
||||
@ -70,7 +71,7 @@
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="changelog"></a><h2>1. Changelog</h2>
|
||||
@ -80,6 +81,12 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<a name="v300"></a><h3>1.i. Changes since 3.0.0</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Change] Validate birthdays (Bug #15004)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc8"></a><h3>1.i. Changes since 3.0.RC8</h3>
|
||||
|
||||
<ul>
|
||||
|
@ -1060,9 +1060,11 @@ class acp_users
|
||||
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
|
||||
}
|
||||
|
||||
$data['bday_day'] = request_var('bday_day', $data['bday_day']);
|
||||
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
|
||||
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
|
||||
$data['bday_day'] = request_var('bday_day', $data['bday_day']);
|
||||
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
|
||||
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
|
||||
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
|
||||
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
@ -1085,6 +1087,7 @@ class acp_users
|
||||
'bday_day' => array('num', true, 1, 31),
|
||||
'bday_month' => array('num', true, 1, 12),
|
||||
'bday_year' => array('num', true, 1901, gmdate('Y', time())),
|
||||
'user_birthday' => array('date', true),
|
||||
));
|
||||
|
||||
// validate custom profile fields
|
||||
@ -1111,7 +1114,7 @@ class acp_users
|
||||
'user_from' => $data['location'],
|
||||
'user_occ' => $data['occupation'],
|
||||
'user_interests'=> $data['interests'],
|
||||
'user_birthday' => sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']),
|
||||
'user_birthday' => $data['user_birthday'],
|
||||
);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
|
@ -1260,6 +1260,45 @@ function validate_num($num, $optional = false, $min = 0, $max = 1E99)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Date
|
||||
* @param String $string a date in the dd-mm-yyyy format
|
||||
* @return boolean
|
||||
*/
|
||||
function validate_date($date_string, $optional = false)
|
||||
{
|
||||
$date = explode('-', $date_string);
|
||||
if ((empty($date) || sizeof($date) != 3) && $optional)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ($optional)
|
||||
{
|
||||
for ($field = 0; $field <= 1; $field++)
|
||||
{
|
||||
$date[$field] = (int) $date[$field];
|
||||
if (empty($date[$field]))
|
||||
{
|
||||
$date[$field] = 1;
|
||||
}
|
||||
}
|
||||
$date[2] = (int) $date[2];
|
||||
// assume an arbitrary leap year
|
||||
if (empty($date[2]))
|
||||
{
|
||||
$date[2] = 1980;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2]))
|
||||
{
|
||||
return 'INVALID';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate Match
|
||||
*
|
||||
|
@ -295,6 +295,7 @@ class ucp_profile
|
||||
$data['bday_day'] = request_var('bday_day', $data['bday_day']);
|
||||
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
|
||||
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
|
||||
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
|
||||
}
|
||||
|
||||
add_form_key('ucp_profile_info');
|
||||
@ -325,6 +326,7 @@ class ucp_profile
|
||||
'bday_day' => array('num', true, 1, 31),
|
||||
'bday_month' => array('num', true, 1, 12),
|
||||
'bday_year' => array('num', true, 1901, gmdate('Y', time()) + 50),
|
||||
'user_birthday' => array('date', true),
|
||||
));
|
||||
}
|
||||
|
||||
@ -359,7 +361,7 @@ class ucp_profile
|
||||
|
||||
if ($config['allow_birthdays'])
|
||||
{
|
||||
$sql_ary['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
|
||||
$sql_ary['user_birthday'] = $data['user_birthday'];
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
|
@ -223,6 +223,7 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'IF_FOLDER_FULL' => 'If folder is full',
|
||||
'IMPORTANT_NEWS' => 'Important announcements',
|
||||
'INVALID_USER_BIRTHDAY' => 'The entered birthday is not a valid date.',
|
||||
'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.',
|
||||
'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.',
|
||||
'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out.',
|
||||
|
Loading…
x
Reference in New Issue
Block a user