Jelajahi Sumber

remove unnecessary decode processes

Yuki Takei 5 tahun lalu
induk
melakukan
c06f50d672

+ 3 - 3
src/client/js/components/Page/CopyDropdown.jsx

@@ -45,7 +45,7 @@ class CopyDropdown extends React.Component {
       search, hash,
       search, hash,
     } = window.location;
     } = window.location;
 
 
-    return decodeURI(`${pagePath}${search}${hash}`);
+    return `${pagePath}${search}${hash}`;
   }
   }
 
 
   generatePagePathUrl() {
   generatePagePathUrl() {
@@ -64,7 +64,7 @@ class CopyDropdown extends React.Component {
     const {
     const {
       origin, search, hash,
       origin, search, hash,
     } = location;
     } = location;
-    return decodeURI(`${origin}/${pageId}${search}${hash}`);
+    return `${origin}/${pageId}${search}${hash}`;
   }
   }
 
 
   generateMarkdownLink() {
   generateMarkdownLink() {
@@ -76,7 +76,7 @@ class CopyDropdown extends React.Component {
     const label = `${pagePath}${search}${hash}`;
     const label = `${pagePath}${search}${hash}`;
     const permalink = this.generatePermalink();
     const permalink = this.generatePermalink();
 
 
-    return decodeURI(`[${label}](${permalink})`);
+    return `[${label}](${permalink})`;
   }
   }
 
 
   DropdownItemContents = ({ title, contents }) => (
   DropdownItemContents = ({ title, contents }) => (

+ 1 - 1
src/server/routes/attachment.js

@@ -485,7 +485,7 @@ module.exports = function(crowi, app) {
    */
    */
   api.add = async function(req, res) {
   api.add = async function(req, res) {
     let pageId = req.body.page_id || null;
     let pageId = req.body.page_id || null;
-    const pagePath = decodeURIComponent(req.body.path) || null;
+    const pagePath = req.body.path || null;
     let pageCreated = false;
     let pageCreated = false;
 
 
     // check params
     // check params