Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
f6b0de13
Commit
f6b0de13
authored
May 03, 2016
by
Simey Lameze
Committed by
Andrew Nicols
May 06, 2016
Browse files
MDL-53913 core_user: make parameters consistent across versions
parent
20e9dac8
Changes
2
Hide whitespace changes
Inline
Side-by-side
auth/db/tests/db_test.php
View file @
f6b0de13
...
...
@@ -431,7 +431,7 @@ class auth_db_testcase extends advanced_testcase {
$user3
->
username
=
'john%#&~%*_doe'
;
$user3
->
email
=
' john@testing.com '
;
$user3
->
deleted
=
'no'
;
$user3
->
description
=
'<b>A description
<script>alert(123)</script>
about myself.</b>'
;
$user3
->
description
=
'<b>A description about myself.</b>'
;
$user3cleaned
=
$auth
->
clean_data
(
$user3
);
// Expected results.
...
...
lib/classes/user.php
View file @
f6b0de13
...
...
@@ -257,15 +257,15 @@ class core_user {
// Every new field on the user table should be added here otherwise it won't be validated.
$fields
=
array
();
$fields
[
'id'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'auth'
]
=
array
(
'type'
=>
PARAM_
NOTAGS
);
$fields
[
'auth'
]
=
array
(
'type'
=>
PARAM_
AUTH
);
$fields
[
'confirmed'
]
=
array
(
'type'
=>
PARAM_BOOL
);
$fields
[
'policyagreed'
]
=
array
(
'type'
=>
PARAM_BOOL
);
$fields
[
'deleted'
]
=
array
(
'type'
=>
PARAM_BOOL
);
$fields
[
'suspended'
]
=
array
(
'type'
=>
PARAM_BOOL
);
$fields
[
'mnethostid'
]
=
array
(
'type'
=>
PARAM_
BOOL
);
$fields
[
'mnethostid'
]
=
array
(
'type'
=>
PARAM_
INT
);
$fields
[
'username'
]
=
array
(
'type'
=>
PARAM_USERNAME
);
$fields
[
'password'
]
=
array
(
'type'
=>
PARAM_
NOTAGS
);
$fields
[
'idnumber'
]
=
array
(
'type'
=>
PARAM_
NOTAGS
);
$fields
[
'password'
]
=
array
(
'type'
=>
PARAM_
RAW
);
$fields
[
'idnumber'
]
=
array
(
'type'
=>
PARAM_
RAW
);
$fields
[
'firstname'
]
=
array
(
'type'
=>
PARAM_NOTAGS
);
$fields
[
'lastname'
]
=
array
(
'type'
=>
PARAM_NOTAGS
);
$fields
[
'surname'
]
=
array
(
'type'
=>
PARAM_NOTAGS
);
...
...
@@ -282,20 +282,20 @@ class core_user {
$fields
[
'department'
]
=
array
(
'type'
=>
PARAM_TEXT
);
$fields
[
'address'
]
=
array
(
'type'
=>
PARAM_TEXT
);
$fields
[
'city'
]
=
array
(
'type'
=>
PARAM_TEXT
);
$fields
[
'country'
]
=
array
(
'type'
=>
PARAM_
TEXT
);
$fields
[
'lang'
]
=
array
(
'type'
=>
PARAM_
TEXT
);
$fields
[
'country'
]
=
array
(
'type'
=>
PARAM_
ALPHA
);
$fields
[
'lang'
]
=
array
(
'type'
=>
PARAM_
LANG
);
$fields
[
'calendartype'
]
=
array
(
'type'
=>
PARAM_NOTAGS
);
$fields
[
'theme'
]
=
array
(
'type'
=>
PARAM_
NOTAGS
);
$fields
[
'timezone
s
'
]
=
array
(
'type'
=>
PARAM_T
EXT
);
$fields
[
'theme'
]
=
array
(
'type'
=>
PARAM_
THEME
);
$fields
[
'timezone'
]
=
array
(
'type'
=>
PARAM_T
IMEZONE
);
$fields
[
'firstaccess'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'lastaccess'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'lastlogin'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'currentlogin'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'lastip'
]
=
array
(
'type'
=>
PARAM_NOTAGS
);
$fields
[
'secret'
]
=
array
(
'type'
=>
PARAM_
TEXT
);
$fields
[
'secret'
]
=
array
(
'type'
=>
PARAM_
RAW
);
$fields
[
'picture'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'url'
]
=
array
(
'type'
=>
PARAM_URL
);
$fields
[
'description'
]
=
array
(
'type'
=>
PARAM_
CLEANHTML
);
$fields
[
'description'
]
=
array
(
'type'
=>
PARAM_
RAW
);
$fields
[
'descriptionformat'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'mailformat'
]
=
array
(
'type'
=>
PARAM_INT
);
$fields
[
'maildigest'
]
=
array
(
'type'
=>
PARAM_INT
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment