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
23cdc367
authored
2011-08-02 20:41:58 +0000
by
Marty Penner
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Adding some password validation rules. refs #1256
1 parent
cdee3976
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
com/Auth/Auth.php
com/Auth/Auth.php
View file @
23cdc36
...
...
@@ -22,6 +22,8 @@ const ACTION_ACTIVATE = 'wpmu_activate_user';
const
OPTION_NAME
=
'tz_auth'
;
// Database lookup key (`wp_options`.`option_name`)
const
PASS_MAX_LEN
=
15
;
// Maximum length of password
call_user_func
(
function
()
{
global
$wpdb
;
if
(
empty
(
$wpdb
->
signups
))
{
...
...
@@ -263,8 +265,12 @@ class Validation extends Common\Validation {
throw
new
Exception
(
'<li>Password can not be blank</li>'
);
}
if
(
false
!==
strpos
(
$val
,
' '
))
{
throw
new
Exception
(
'<li>Password can not contain spaces</li>'
);
if
(
isset
(
$val
[
PASS_MAX_LEN
+
1
]))
{
throw
new
Exception
(
'<li>Password can not be longer than '
.
PASS_MAX_LEN
.
' characters.</li>'
);
}
if
(
preg_match
(
'/(\\\\|\\\'|"| )+/i'
,
$val
))
{
throw
new
Exception
(
'<li>Password can not contain spaces, backslashes (\) or quotes</li>'
);
}
}
...
...
Please
register
or
sign in
to post a comment