@social-mail/social-mail-web-server 1.8.393 → 1.8.395

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.393",
3
+ "version": "1.8.395",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -10,6 +10,7 @@ import WebContentTranspileService from "./web-content/WebContentTranspileService
10
10
  import { ISiteFolder } from "./ISiteFolder.js";
11
11
  import EncryptionService from "../encryption/EncryptionService.js";
12
12
  import { hash } from "crypto";
13
+ import Sql from "@entity-access/entity-access/dist/sql/Sql.js";
13
14
 
14
15
  @RegisterScoped
15
16
  export default class WebSiteContentService
@@ -92,9 +93,11 @@ export default class WebSiteContentService
92
93
  @cacheFor()
93
94
  async getFileInfo(folderID, ... segments: string[]): Promise<IFileInfo> {
94
95
  const [top, ... paths] = segments;
96
+ const eTop = top.replace(/(\%|\_)/i, (x) => "\\" + x);
95
97
  const child = await this.db.appFiles
96
- .where({ folderID, top },(p) => (x) => x.parentID === p.folderID && x.name === p.top)
98
+ .where({ folderID, eTop },(p) => (x) => x.parentID === p.folderID && Sql.text.iLike(x.name, p.eTop))
97
99
  .orderBy(void 0, (p) => (x) => x.isDeleted)
100
+ .thenByDescending({ top }, (p) => (x) => x.name === p.top)
98
101
  .first();
99
102
  if (!child) {
100
103
  return null;