diff --git a/core/users/user_edit.php b/core/users/user_edit.php
index 8b8df245c0..907da051b5 100644
--- a/core/users/user_edit.php
+++ b/core/users/user_edit.php
@@ -675,7 +675,7 @@ if (count($_POST) > 0 && $_POST["persistform"] != "1") {
echo " ".$text['label-status']."\n";
echo " \n";
echo "
\n";
- $cmd = "'".PROJECT_PATH."/app/calls_active/v_calls_exec.php?cmd=callcenter_config+agent+set+status+".$username."@".$_SESSION['domains'][$domain_uuid]['domain_name']."+'+this.value";
+ $cmd = "'".PROJECT_PATH."/app/calls_active/v_calls_exec.php?cmd=callcenter_config+agent+set+status+".escape($username)."@".$_SESSION['domains'][$domain_uuid]['domain_name']."+'+this.value";
echo " |