Răsfoiți Sursa

Merge pull request #8413 from weseek/fix/138850-prevent-duplication-of-user-pages

fix: Preventing duplication of `/user/username` pages
Yuki Takei 2 ani în urmă
părinte
comite
2d3229bf00
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      packages/core/src/utils/page-path-utils/index.ts

+ 1 - 1
packages/core/src/utils/page-path-utils/index.ts

@@ -114,7 +114,7 @@ const restrictedPatternsToCreate: Array<RegExp> = [
   /\\/, // see: https://github.com/weseek/growi/issues/7241
   /^\/(_search|_private-legacy-pages)(\/.*|$)/,
   /^\/(installer|register|login|logout|admin|me|files|trash|paste|comments|tags|share|attachment)(\/.*|$)/,
-  /^\/user\/[^/]+$/, // see: https://regex101.com/r/utVQct/1
+  /^\/user(?:\/[^/]+)?$/, // https://regex101.com/r/9Eh2S1/1
 ];
 export const isCreatablePage = (path: string): boolean => {
   return !restrictedPatternsToCreate.some(pattern => path.match(pattern));