Index: /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWeb.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWeb.php	(revision 20399)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWeb.php	(working copy)
@@ -341,7 +341,7 @@
 		$t_jsAppend = 'var gResourceWebDataValue = [';
 		$this->jsAppend .= 'var gResourceWebDataText = [';
 		while (list($t_key, $t_data) = each($this->vResourceWebList)) {
-			$this->jsAppend .=  '["' . helper::makeHTMLSafe($t_data[0]) . '", "' . helper::makeHTMLSafe($t_data[1]) . '", "' . helper::makeHTMLSafe($t_data[2]) . '", "' . helper::makeHTMLSafe($t_data[3]) . '", "' . helper::makeHTMLSafe($t_data[4]) . '", "' . helper::makeHTMLSafe($t_data[5]) . '", "' . helper::makeHTMLSafe($t_data[6]) . '", "' . helper::makeHTMLSafe($t_data[7]) . '"],';
+			$this->jsAppend .=  '["' . helper::makeHTMLSafe($t_data[0]) . '", "' . helper::makeHTMLSafe($t_data[1]) . '", "' . $this->makeHTMLSafeForJsonEncode($t_data[2]) . '", "' . helper::makeHTMLSafe($t_data[3]) . '", "' . helper::makeHTMLSafe($t_data[4]) . '", "' . helper::makeHTMLSafe($t_data[5]) . '", "' . helper::makeHTMLSafe($t_data[6]) . '", "' . helper::makeHTMLSafe($t_data[7]) . '"],';
 			$t_jsAppend     .=  '["' . helper::makeFORMSafe($t_data[0]) . '", "' . helper::makeFORMSafe($t_data[1]) . '", "' . helper::makeFORMSafe($t_data[2]) . '", "' . helper::makeFORMSafe($t_data[3]) . '", "' . helper::makeFORMSafe($t_data[4]) . '", "' . helper::makeFORMSafe($t_data[5]) . '", "' . helper::makeFORMSafe($t_data[6]) . '", "' . helper::makeFORMSafe($t_data[7]) . '"],';
 		}
 		$this->jsAppend .= '];';
@@ -747,6 +747,22 @@
     function setJsOnSaveAppend () {
 		// Example:  $this->jsOnSaveAppend .= 'window.alert("Hello from setJsOnSaveAppend...");';
 	}
-	
-}		
+
+	/********************************************************************
+	*
+	* Make html safe for json encode text
+	*
+	* $param	string $str json encoded text
+	* @return	string
+	*
+	********************************************************************/
+    function makeHTMLSafeForJsonEncode ($str) {
+		$t_trans = get_html_translation_table(HTML_SPECIALCHARS);
+		$t_trans['$'] = '&#036;';
+		$add_qutes = '"' . $str . '"';
+		$decoded = json_decode($add_qutes);
+		return strtr($decoded, $t_trans);
+	}
+
+}
 ?>
Index: /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWebAdd.php
===================================================================
--- /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWebAdd.php	(revision 20399)
+++ /branches/rel_ag_9_4_5/webui/proxy/new/incVirtual/role/class.cliWrap_vRoleResourceWebAdd.php	(working copy)
@@ -87,7 +87,8 @@
 			$this->editURL = $_POST['cliWrap_vRoleResourceWeb_editURL'];
 		}
 		if (isset($_POST['cliWrap_vRoleResourceWeb_editDisplayName'])) {
-			$this->editDisplayName = $_POST['cliWrap_vRoleResourceWeb_editDisplayName'];
+			$add_quote = '"' . $_POST['cliWrap_vRoleResourceWeb_editDisplayName'] . '"';
+			$this->editDisplayName = json_decode($add_quote);
 		}
 		if (isset($_POST['cliWrap_vRoleResourceWeb_editPositon'])) {
 			$this->editPosition = $_POST['cliWrap_vRoleResourceWeb_editPositon'];
@@ -191,21 +192,23 @@
 					} else {
 						$t_frontend_SSO = 0;
 					}
+					$input_web_name = trim(json_encode($_POST[$this->classId . '_web_name']), '"');
 					$t_errStr = cli::exec_direct(CMD_ROLE_RESOURCE_WEB, $_POST[$this->classId . '_role_name'], $_POST[$this->classId . '_web_url'],
-										$_POST[$this->classId . '_web_name'], $_POST[$this->classId . '_web_position'], $t_auto_gen_permit_acl, $t_direct_link, $t_frontend_SSO, $this->defaultDeviceID);
-	    			if (!($t_errStr->result)) {
-	    				$this->showMessage(cli::get_reason_info($t_errStr));
+										$input_web_name, $_POST[$this->classId . '_web_position'], $t_auto_gen_permit_acl, $t_direct_link, $t_frontend_SSO, $this->defaultDeviceID);
+					if (!($t_errStr->result)) {
+						$this->showMessage(cli::get_reason_info($t_errStr));
+						$input_editDisplayName = trim(json_encode($_POST['cliWrap_vRoleResourceWeb_editDisplayName']), '"');
 						$t_old_auto_gen_permit_acl = ($_POST['cliWrap_vRoleResourceWeb_editAutoGenPermitAcl'] == language::translate('yes')) ? 1 : 0;
 						$t_old_direct_link = ($_POST['cliWrap_vRoleResourceWeb_editDirectLink'] == language::translate('yes')) ? 1 : 0;
 						$t_frontend_SSO = ($_POST['cliWrap_vRoleResourceWeb_editFrontendSSO'] == language::translate('yes')) ? 1 : 0;
 						$t_errStr = cli::exec_direct(CMD_ROLE_RESOURCE_WEB, $_POST['cliWrap_vRoleResourceWeb_editRoleName'], $_POST['cliWrap_vRoleResourceWeb_editURL'],
-										$_POST['cliWrap_vRoleResourceWeb_editDisplayName'], $_POST['cliWrap_vRoleResourceWeb_editPositon'], $t_old_auto_gen_permit_acl, $t_old_direct_link, $t_frontend_SSO, $this->defaultDeviceID);
-	    				break;
-	    			} else if (count($t_errStr->content)) {
-	    				$this->showMessage($t_errStr->content[0]->str);
-	    				break;
-	    			}
-	    			if ($data != ($this->classId . '_SaveAndAddAnother')) {
+										$input_editDisplayName, $_POST['cliWrap_vRoleResourceWeb_editPositon'], $t_old_auto_gen_permit_acl, $t_old_direct_link, $t_frontend_SSO, $this->defaultDeviceID);
+						break;
+					} else if (count($t_errStr->content)) {
+						$this->showMessage($t_errStr->content[0]->str);
+						break;
+					}
+					if ($data != ($this->classId . '_SaveAndAddAnother')) {
 						$this->setActionResult('redirect');
 					}
 					break;
