Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f336d049
Commit
f336d049
authored
Aug 08, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Html escaped from display name in xblock.
LMS-11194
parent
7225420f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
cms/djangoapps/contentstore/features/course-outline.feature
+1
-1
cms/djangoapps/contentstore/features/course-outline.py
+1
-1
cms/djangoapps/contentstore/features/problem-editor.feature
+6
-0
cms/djangoapps/contentstore/features/problem-editor.py
+16
-0
common/lib/xmodule/xmodule/x_module.py
+1
-1
No files found.
cms/djangoapps/contentstore/features/course-outline.feature
View file @
f336d049
...
...
@@ -25,7 +25,7 @@ Feature: CMS.Course Outline
Scenario
:
Collapse link is removed after last section of a course is deleted
Given
I have a course with 1 section
And
I navigate to the course outline page
And
I press the
"section"
delete icon
And
I press the
section
delete icon
When
I will confirm all alerts
Then
I do not see the
"Collapse All Sections"
link
...
...
cms/djangoapps/contentstore/features/course-outline.py
View file @
f336d049
...
...
@@ -67,7 +67,7 @@ def i_add_a_section(step):
add_section
()
@step
(
u'I press the
"section"
delete icon'
)
@step
(
u'I press the
section
delete icon'
)
def
i_press_the_section_delete_icon
(
step
):
delete_locator
=
'section .outline-section > .section-header a.delete-button'
world
.
css_click
(
delete_locator
)
...
...
cms/djangoapps/contentstore/features/problem-editor.feature
View file @
f336d049
...
...
@@ -30,6 +30,12 @@ Feature: CMS.Problem Editor
Then
I can revert the display name to unset
And
my display name is unset on save
Scenario
:
User can specify html in display name and it will be escaped
Given
I have created a Blank Common Problem
When
I edit and select Settings
Then
I can specify html in the display name and save
And
the problem display name is
"<script>alert('test')</script>"
# IE will not click the revert button properly
@skip_internetexplorer
Scenario
:
User can select values in a Select
...
...
cms/djangoapps/contentstore/features/problem-editor.py
View file @
f336d049
...
...
@@ -133,6 +133,18 @@ def i_can_modify_the_display_name_with_special_chars(_step):
verify_modified_display_name_with_special_chars
()
@step
(
'I can specify html in the display name and save'
)
def
i_can_modify_the_display_name_with_html
(
_step
):
"""
If alert appear on save then UnexpectedAlertPresentException
will occur and test will fail.
"""
index
=
world
.
get_setting_entry_index
(
DISPLAY_NAME
)
world
.
set_field_value
(
index
,
"<script>alert('test')</script>"
)
verify_modified_display_name_with_html
()
world
.
save_component
()
@step
(
'my special characters and persisted on save'
)
def
special_chars_persisted_on_save
(
step
):
world
.
save_component_and_reopen
(
step
)
...
...
@@ -350,6 +362,10 @@ def verify_modified_display_name_with_special_chars():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
DISPLAY_NAME
),
DISPLAY_NAME
,
"updated '
\"
&"
,
True
)
def
verify_modified_display_name_with_html
():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
DISPLAY_NAME
),
DISPLAY_NAME
,
"<script>alert('test')</script>"
,
True
)
def
verify_unset_display_name
():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
DISPLAY_NAME
),
DISPLAY_NAME
,
'Blank Advanced Problem'
,
False
)
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
f336d049
...
...
@@ -231,7 +231,7 @@ class XModuleMixin(XBlockMixin):
name
=
self
.
display_name
if
name
is
None
:
name
=
self
.
url_name
.
replace
(
'_'
,
' '
)
return
name
return
name
.
replace
(
'<'
,
'<'
)
.
replace
(
'>'
,
'>'
)
@property
def
xblock_kvs
(
self
):
...
...
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