Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
captcha
Commits
1d2ae9b1
Commit
1d2ae9b1
authored
Dec 20, 2016
by
Vagelis
Committed by
Lachlan Ennis
Dec 20, 2016
Browse files
Issue #2833733 by Vagelis: "Javascript" should be "JavaScript"
parent
e11efbea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
captcha.admin.inc
captcha.admin.inc
+1
-1
captcha.js
captcha.js
+1
-1
captcha.module
captcha.module
+1
-1
captcha.test
captcha.test
+3
-3
image_captcha/image_captcha.admin.inc
image_captcha/image_captcha.admin.inc
+1
-1
No files found.
captcha.admin.inc
View file @
1d2ae9b1
...
...
@@ -41,7 +41,7 @@ function _captcha_available_challenge_types($add_special_options = TRUE) {
function
captcha_admin_settings
()
{
module_load_include
(
'inc'
,
'captcha'
);
// Use
j
ava
s
cript for some added usability on admin form.
// Use
J
ava
S
cript for some added usability on admin form.
drupal_add_js
(
drupal_get_path
(
'module'
,
'captcha'
)
.
'/captcha.js'
);
// Configuration of which forms to protect, with what challenge.
...
...
captcha.js
View file @
1d2ae9b1
...
...
@@ -4,7 +4,7 @@
attach
:
function
(
context
)
{
// Turn off autocompletion for the CAPTCHA response field.
// We do it here with Java
s
cript (instead of directly in the markup)
// We do it here with Java
S
cript (instead of directly in the markup)
// because this autocomplete attribute is not standard and
// it would break (X)HTML compliance.
$
(
"
#edit-captcha-response
"
).
attr
(
"
autocomplete
"
,
"
off
"
);
...
...
captcha.module
View file @
1d2ae9b1
...
...
@@ -181,7 +181,7 @@ function captcha_element_process($element, &$form_state, $complete_form) {
module_load_include
(
'inc'
,
'captcha'
);
// Add Java
s
cript for general CAPTCHA functionality.
// Add Java
S
cript for general CAPTCHA functionality.
drupal_add_js
(
drupal_get_path
(
'module'
,
'captcha'
)
.
'/captcha.js'
);
// Prevent caching of the page with CAPTCHA elements.
...
...
captcha.test
View file @
1d2ae9b1
...
...
@@ -606,16 +606,16 @@ class CaptchaAdminTestCase extends CaptchaBaseWebTestCase {
// Set CAPTCHA on user register form.
captcha_set_form_id_setting
(
'user_register'
,
'captcha/Math'
);
// Put Java
s
cript snippet in CAPTCHA description.
// Put Java
S
cript snippet in CAPTCHA description.
$this
->
drupalLogin
(
$this
->
admin_user
);
$xss
=
'<script type="text/javascript">alert("xss")</script>'
;
$edit
=
array
(
'captcha_description'
=>
$xss
);
$this
->
drupalPost
(
self
::
CAPTCHA_ADMIN_PATH
,
$edit
,
'Save configuration'
);
// Visit user register form and check if Java
s
cript snippet is there.
// Visit user register form and check if Java
S
cript snippet is there.
$this
->
drupalLogout
();
$this
->
drupalGet
(
'user/register'
);
$this
->
assertNoRaw
(
$xss
,
'Java
s
cript should not be allowed in CAPTCHA description.'
,
'CAPTCHA'
);
$this
->
assertNoRaw
(
$xss
,
'Java
S
cript should not be allowed in CAPTCHA description.'
,
'CAPTCHA'
);
}
...
...
image_captcha/image_captcha.admin.inc
View file @
1d2ae9b1
...
...
@@ -14,7 +14,7 @@ function image_captcha_settings_form() {
// Add CSS for theming of admin form.
$form
[
'#attached'
][
'css'
]
=
array
(
drupal_get_path
(
'module'
,
'image_captcha'
)
.
'/image_captcha.css'
);
// Use
j
ava
s
cript for some added usability on admin form.
// Use
J
ava
S
cript for some added usability on admin form.
$form
[
'#attached'
][
'js'
]
=
array
(
drupal_get_path
(
'module'
,
'image_captcha'
)
.
'/image_captcha.js'
);
// First some error checking.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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