Skip to content
Snippets Groups Projects
Commit c7094197 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Sanitize HTML

parent f4c9d4c0
Branches
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<ul id="settings" class="svg"> <ul id="settings" class="svg">
<span id="expand"> <span id="expand">
<?php echo OCP\User::getDisplayName($user=null)?OCP\User::getDisplayName($user=null):(OC_User::getUser()?OC_User::getUser():'') ?> <?php echo OCP\User::getDisplayName($user=null)?OC_Util::sanitizeHTML(OCP\User::getDisplayName($user=null)):(OC_User::getUser()?OC_User::getUser():'') ?>
<img class="svg" src="<?php echo image_path('', 'actions/caret.svg'); ?>" /> <img class="svg" src="<?php echo image_path('', 'actions/caret.svg'); ?>" />
</span> </span>
<div id="expanddiv"> <div id="expanddiv">
......
...@@ -308,7 +308,7 @@ $(document).ready(function () { ...@@ -308,7 +308,7 @@ $(document).ready(function () {
event.stopPropagation(); event.stopPropagation();
var img = $(this); var img = $(this);
var uid = img.parent().parent().attr('data-uid'); var uid = img.parent().parent().attr('data-uid');
var displayName = img.parent().parent().attr('data-displayName'); var displayName = escapeHTML(img.parent().parent().attr('data-displayName'));
var input = $('<input type="text" value="' + displayName + '">'); var input = $('<input type="text" value="' + displayName + '">');
img.css('display', 'none'); img.css('display', 'none');
img.parent().children('span').replaceWith(input); img.parent().children('span').replaceWith(input);
...@@ -329,7 +329,7 @@ $(document).ready(function () { ...@@ -329,7 +329,7 @@ $(document).ready(function () {
} }
}); });
input.blur(function () { input.blur(function () {
$(this).replaceWith($(this).val()); $(this).replaceWith(escapeHTML($(this).val()));
img.css('display', ''); img.css('display', '');
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment