public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM-5992]: Escape character shown when server/database name has some special characters.
Date: Thu, 26 Nov 2020 13:43:34 +0530
Message-ID: <CAOBg0AMWVcFVFG09OA8pE63dmhNR=MTe4j5Wm=dkOw7eMbrJBw@mail.gmail.com> (raw)

Hi Team,

Please find the patch for RM-5992
<https://redmine.postgresql.org/issues/5992;: Escape character shown when
server/database name has some special characters.

-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*


Attachments:

  [application/octet-stream] RM_5992.patch (3.0K, 3-RM_5992.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
index 258e83d..721b583 100644
--- a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
+++ b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
@@ -74,20 +74,20 @@ export function setQueryToolDockerTitle(panel, is_query_tool, panel_title, is_fi
 export function generateTitle(title_placeholder, title_data) {
 
   if(title_data.type == 'query_tool') {
-    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), title_data.database);
-    title_placeholder = title_placeholder.replace(new RegExp('%USERNAME%'), title_data.username);
-    title_placeholder = title_placeholder.replace(new RegExp('%SERVER%'), title_data.server);
+    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), _.unescape(title_data.database));
+    title_placeholder = title_placeholder.replace(new RegExp('%USERNAME%'), _.unescape(title_data.username));
+    title_placeholder = title_placeholder.replace(new RegExp('%SERVER%'), _.unescape(title_data.server));
   } else if(title_data.type == 'datagrid') {
-    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), title_data.database);
-    title_placeholder = title_placeholder.replace(new RegExp('%USERNAME%'), title_data.username);
-    title_placeholder = title_placeholder.replace(new RegExp('%SERVER%'), title_data.server);
-    title_placeholder = title_placeholder.replace(new RegExp('%SCHEMA%'), title_data.schema);
-    title_placeholder = title_placeholder.replace(new RegExp('%TABLE%'), title_data.table);
+    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), _.unescape(title_data.database));
+    title_placeholder = title_placeholder.replace(new RegExp('%USERNAME%'), _.unescape(title_data.username));
+    title_placeholder = title_placeholder.replace(new RegExp('%SERVER%'), _.unescape(title_data.server));
+    title_placeholder = title_placeholder.replace(new RegExp('%SCHEMA%'), _.unescape(title_data.schema));
+    title_placeholder = title_placeholder.replace(new RegExp('%TABLE%'), _.unescape(title_data.table));
   } else if(title_data.type == 'debugger') {
-    title_placeholder = title_placeholder.replace(new RegExp('%FUNCTION%'), title_data.function_name);
-    title_placeholder = title_placeholder.replace(new RegExp('%ARGS%'), title_data.args);
-    title_placeholder = title_placeholder.replace(new RegExp('%SCHEMA%'), title_data.schema);
-    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), title_data.database);
+    title_placeholder = title_placeholder.replace(new RegExp('%FUNCTION%'), _.unescape(title_data.function_name));
+    title_placeholder = title_placeholder.replace(new RegExp('%ARGS%'), _.unescape(title_data.args));
+    title_placeholder = title_placeholder.replace(new RegExp('%SCHEMA%'), _.unescape(title_data.schema));
+    title_placeholder = title_placeholder.replace(new RegExp('%DATABASE%'), _.unescape(title_data.database));
   }
 
   return _.escape(title_placeholder);


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM-5992]: Escape character shown when server/database name has some special characters.
  In-Reply-To: <CAOBg0AMWVcFVFG09OA8pE63dmhNR=MTe4j5Wm=dkOw7eMbrJBw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox