Explorar el Código

fix: use replace instead of replaceAll to support pre-Node16

NGPixel hace 3 años
padre
commit
5173c4802e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      server/helpers/page.js

+ 1 - 1
server/helpers/page.js

@@ -35,7 +35,7 @@ module.exports = {
     rawPath = rawPath.replace(unsafeCharsRegex, '')
     if (rawPath === '') { rawPath = 'home' }
 
-    rawPath = rawPath.replaceAll('\\', '').replaceAll('//', '').replaceAll(/\.\.+/ig, '')
+    rawPath = rawPath.replace(/\\/g, '').replace(/\/\//g, '').replace(/\.\.+/ig, '')
 
     // Extract Info
     let pathParts = _.filter(_.split(rawPath, '/'), p => {