Skip to content

Commit

Permalink
chore(Profile Settings) rename profile: eliminate use of escapeAll fu…
Browse files Browse the repository at this point in the history
…nction in favor of encodeURIComponent.
  • Loading branch information
joebordes committed Sep 8, 2016
1 parent df69c50 commit 939a611
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions Smarty/templates/ProfileDetailView.tpl
Expand Up @@ -21,20 +21,10 @@
<script type="text/javascript" src="include/js/smoothscroll.js"></script>
<script type="text/javascript">
{literal}
function UpdateProfile()
{
if(default_charset.toLowerCase() == 'utf-8')
{
var prof_name = document.getElementById('profile_name').value;
var prof_desc = document.getElementById('description').value;
}
else
{
var prof_name = escapeAll(document.getElementById('profile_name').value);
var prof_desc = escapeAll(document.getElementById('description').value);
}
if(prof_name == '')
{
function UpdateProfile() {
var prof_name = document.getElementById('profile_name').value;
var prof_desc = document.getElementById('description').value;
if(prof_name == '') {
document.getElementById('profile_name').focus();
{/literal}
alert("{$APP.PROFILENAME_CANNOT_BE_EMPTY}");
Expand All @@ -43,7 +33,7 @@ function UpdateProfile()
else
{
{/literal}
var urlstring ="module=Users&action=UsersAjax&file=RenameProfile&profileid="+{$PROFILEID}+"&profilename="+prof_name+"&description="+prof_desc;
var urlstring = "module=Users&action=UsersAjax&file=RenameProfile&profileid="+{$PROFILEID}+"&profilename="+encodeURIComponent(prof_name)+"&description="+encodeURIComponent(prof_desc);
{literal}
jQuery.ajax({
method: 'POST',
Expand Down

0 comments on commit 939a611

Please sign in to comment.