Commit e918cda4 authored by Jason Frisvold's avatar Jason Frisvold
Browse files

Email address limit changed from 320 to 256 as per RFC

parent cf26fc73
1.0 Yup, 0.9 went "unreleased"
Switched from Prototype/Scriptaculous to jQuery and jQueryUI
Clean up some variable naming consistency problems
Add a favicon (Thanks http://www.favicon.cc/?action=icon&file_id=11570)
Clean up some variable naming consistency problems
Add a favicon (Thanks http://www.favicon.cc/?action=icon&file_id=11570)
Update the copyright years
New search feature
Added a config option to force HTTPS
Some general file cleanup (remove ID tags, unused code, etc)
New ajax code to handle adding/modifying/deleting feeds
Moved to git, removing old SVN tags
Remove wml files.. Seriously.. It's not happening.. Thankfully.
Switch to a smarty-based RSS generator, removed feedcreator
Remove ATOM 0.3 support, add RSS 0.92 support
Rename classTodoItem to phpTodoItem to be consistent
SQL changes to support new feeds
Add Smarty whitespace pre-filter (http://blog.rodneyrehm.de/archives/16-Smarty-Whitespace-Control.html)
New tag handling code for preferences (merge, split, delete)
Added a config option to force HTTPS
Some general file cleanup (remove ID tags, unused code, etc)
New ajax code to handle adding/modifying/deleting feeds
Moved to git, removing old SVN tags
Remove wml files.. Seriously.. It's not happening.. Thankfully.
Switch to a smarty-based RSS generator, removed feedcreator
Remove ATOM 0.3 support, add RSS 0.92 support
Rename classTodoItem to phpTodoItem to be consistent
SQL changes to support new feeds
Add Smarty whitespace pre-filter (http://blog.rodneyrehm.de/archives/16-Smarty-Whitespace-Control.html)
New tag handling code for preferences (merge, split, delete)
Email address length was limited to 320 characters. This is incorrect as per RFC 5321, it should be 256 characters. (Thanks Deepak Vasudevan)
Updated code to handle new 256 character email limit
0.9 Don't include cookies in the redirect URL
Rename the session cookie to avoid naming collisions
......
......@@ -27,6 +27,8 @@ ALTER TABLE feed_version DROP version;
ALTER TABLE feed_version ADD (template CHAR(25) NOT NULL,
icon CHAR(25) NOT NULL);
ALTER TABLE users MODIFY email VARCHAR(254) NOT NULL;
INSERT INTO feed_version VALUES (NULL, 'RSS 0.92', 'feed-rss092.tpl', 'rss.gif');
UPDATE feed_version SET template = 'feed-rss091.tpl', icon = 'rss.gif' WHERE name = 'RSS 0.91';
......
......@@ -29,7 +29,7 @@ CREATE TABLE users (id INTEGER UNSIGNED NOT NULL AUTO_
password CHAR(40) NOT NULL,
admin TINYINT UNSIGNED NOT NULL DEFAULT 0,
full_name CHAR(40),
email VARCHAR(320) NOT NULL,
email VARCHAR(254) NOT NULL,
PRIMARY KEY (id),
UNIQUE (username),
INDEX (password));
......
......@@ -18,7 +18,7 @@
function saveuser() {
var usernameRegex = /^[a-zA-Z0-9_\-]{1,15}$/;
var fullnameRegex = /^[a-zA-Z0-9_\-\ \']{1,40}$/;
var emailRegex = /^[a-zA-Z0-9_\-\.!#\$%&\*\+\/=\?\^\{\|\}~]{0,64}@[a-zA-Z0-9\-\.]{0,255}$/;
var emailRegex = /^([a-zA-Z0-9_\-\.!#\$%&\*\+\/=\?\^\{\|\}~]{0,64}@[a-zA-Z0-9\-\.]{0,255}){0,256}$/;
var pwdRegex = /^[a-zA-Z0-9@#$%\^&\*\/]{4,15}$/;
if (! usernameRegex.test(document.forms.usermod.username.value)) {
......@@ -35,9 +35,9 @@ function saveuser() {
}
if (! emailRegex.test(document.forms.usermod.email.value)) {
alert('Invalid email address. Email addresses can be up to 320 ' +
alert('Invalid email address. Email addresses can be up to 256 ' +
'characters using only the following :\na-z A-Z 0-9 ! @ # ' +
'$ % ^ & * / (See RFC 2822)');
'$ % ^ & * / (See RFC 2822, 3696, 5321)');
return(false);
}
......
......@@ -36,7 +36,7 @@ class phpTodoUser {
private $user_id; // Integer
private $username; // Char(15)
private $fullname; // Char(40)
private $email; // Char(320)
private $email; // Text (Max 256 characters)
private $adminflag; // Boolean (TinyInt)
private $logged_in; // Boolean
......@@ -331,7 +331,7 @@ class phpTodoUser {
* address fails validation
*/
public function email($email = '') {
$phpTodo_emailRegex = '/^[a-zA-Z0-9_\-\.!#\$%&\*\+\/=\?\^\{\|\}~]{0,64}@[a-zA-Z0-9\-\.]{0,255}\z/';
$phpTodo_emailRegex = '/^([a-zA-Z0-9_\-\.!#\$%&\*\+\/=\?\^\{\|\}~]{0,64}@[a-zA-Z0-9\-\.]{0,255}){0,256)\z/';
if (! empty($email) && (! strcmp($email, $this->email) == 0)) {
if (preg_match($phpTodo_emailRegex, $email)) {
$this->email = $email;
......
......@@ -114,7 +114,7 @@
</td><td>
<input name='fullname' size='40' maxlength='40' value='{$edit_fullname|default:""}' />
</td><td>
<input name='email' size='30' maxlength='320' value='{$edit_email|default:""}' />
<input name='email' size='30' maxlength='256' value='{$edit_email|default:""}' />
</td><td>
<input type='password' name='password' size='15' maxlength='15' />
<input name='userid' type='hidden' value='{$edit_userid|default:""}' />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment