Make uses of quote_slashes always operate on encoded strings
This commit is contained in:
@@ -16,7 +16,7 @@ def handler_url(block, handler_name, suffix='', query='', thirdparty=False):
|
||||
raise NotImplementedError("edX Studio doesn't support third-party xblock handler urls")
|
||||
|
||||
url = reverse('component_handler', kwargs={
|
||||
'usage_id': quote_slashes(str(block.scope_ids.usage_id)),
|
||||
'usage_id': quote_slashes(unicode(block.scope_ids.usage_id).encode('utf-8')),
|
||||
'handler': handler_name,
|
||||
'suffix': suffix,
|
||||
}).rstrip('/')
|
||||
|
||||
@@ -71,12 +71,12 @@ def wrap_xblock(runtime_class, block, view, frag, context, display_name_only=Fal
|
||||
data['runtime-class'] = runtime_class
|
||||
data['runtime-version'] = frag.js_init_version
|
||||
data['block-type'] = block.scope_ids.block_type
|
||||
data['usage-id'] = quote_slashes(str(block.scope_ids.usage_id))
|
||||
data['usage-id'] = quote_slashes(unicode(block.scope_ids.usage_id).encode('utf-8'))
|
||||
|
||||
template_context = {
|
||||
'content': block.display_name if display_name_only else frag.content,
|
||||
'classes': css_classes,
|
||||
'data_attributes': ' '.join('data-{}="{}"'.format(key, value) for key, value in data.items()),
|
||||
'data_attributes': ' '.join(u'data-{}="{}"'.format(key, value) for key, value in data.items()),
|
||||
}
|
||||
|
||||
return wrap_fragment(frag, render_to_string('xblock_wrapper.html', template_context))
|
||||
|
||||
Reference in New Issue
Block a user