Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0e9b3cf4
authored
2017-04-28 20:16:38 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
recaptcha
1 parent
b91a8ab1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
com/Auth/Auth.php
com/Auth/Auth.php
View file @
0e9b3cf
...
...
@@ -196,11 +196,7 @@ function activate($key, $password_validation = null) {
// Do I need to re-sanatize this?
$meta
=
unserialize
(
$signup
->
meta
);
if
(
!
is_null
(
$password_validation
))
{
if
(
$meta
[
'password'
]
!=
$password_validation
)
{
throw
new
Exception
(
'Bad password match'
);
}
}
$id
=
_create_user
(
$signup
->
user_login
,
$meta
[
'password'
],
$signup
->
user_email
);
unset
(
$meta
[
'password'
]);
...
...
@@ -240,18 +236,18 @@ class Validation extends Common\Validation {
*/
protected
function
username
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Username is blank'
,
CBV_DOMAIN
)
.
'</li>'
);
throw
new
Exception
(
'<li>'
.
__
(
'Username is blank'
,
'cicbv-front-end'
)
.
'</li>'
);
}
require_once
(
ABSPATH
.
WPINC
.
DIRECTORY_SEPARATOR
.
'registration.php'
);
if
(
!
validate_username
(
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Username must be at least 4 characters, letters and numbers only'
,
CBV_DOMAIN
)
.
'</li>'
'<li>'
.
__
(
'Username must be at least 4 characters, letters and numbers only'
,
'cicbv-front-end'
)
.
'</li>'
);
}
if
(
username_exists
(
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Username already exists'
,
CBV_DOMAIN
)
.
'</li>'
);
throw
new
Exception
(
'<li>'
.
__
(
'Username already exists'
,
'cicbv-front-end'
)
.
'</li>'
);
}
}
...
...
@@ -262,18 +258,18 @@ class Validation extends Common\Validation {
*/
protected
function
password
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Password can not be blank'
,
CBV_DOMAIN
)
.
'</li>'
);
throw
new
Exception
(
'<li>'
.
__
(
'Password can not be blank'
,
'cicbv-front-end'
)
.
'</li>'
);
}
if
(
isset
(
$val
[
PASS_MAX_LEN
]))
{
throw
new
Exception
(
'<li>'
.
sprintf
(
__
(
'Password can not be longer than %d characters.'
,
CBV_DOMAIN
),
PASS_MAX_LEN
)
.
'</li>'
'<li>'
.
sprintf
(
__
(
'Password can not be longer than %d characters.'
,
'cicbv-front-end'
),
PASS_MAX_LEN
)
.
'</li>'
);
}
if
(
preg_match
(
'/(\\\\|\\\'|"| )+/i'
,
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Password can not contain spaces, backslashes (\) or quotes'
,
CBV_DOMAIN
)
.
'</li>'
'<li>'
.
__
(
'Password can not contain spaces, backslashes (\) or quotes'
,
'cicbv-front-end'
)
.
'</li>'
);
}
}
...
...
@@ -284,11 +280,11 @@ class Validation extends Common\Validation {
*/
protected
function
email
(
$val
)
{
if
(
!
(
boolean
)
filter_var
(
$val
,
FILTER_VALIDATE_EMAIL
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Invalid email address'
,
CBV_DOMAIN
)
.
'</li>'
);
throw
new
Exception
(
'<li>'
.
__
(
'Invalid email address'
,
'cicbv-front-end'
)
.
'</li>'
);
}
if
(
false
!==
email_exists
(
$val
))
{
throw
new
Exception
(
'<li>'
.
__
(
'Email address already registered'
,
CBV_DOMAIN
)
.
' </li > '
);
throw
new
Exception
(
'<li>'
.
__
(
'Email address already registered'
,
'cicbv-front-end'
)
.
' </li > '
);
}
}
}
...
...
Please
register
or
sign in
to post a comment