Skip to content

Conversation

pavelfeldman
Copy link
Member

@pavelfeldman pavelfeldman force-pushed the sanitize branch 2 times, most recently from c9e0085 to f0583b3 Compare September 19, 2025 22:41
export function sanitizeForFilePath(outputDir: string, name: string) {
const base = path.resolve(outputDir);
// Fast path, permissive
const lax = name.split(path.sep).map(s => s.replace(/[\x00-\x1F\x22\x2A\x2F\x3A\x3C\x3E\x3F\x5C\x7C\x7F]/g, '-').trim()).join(path.sep);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is a file name why does it have path.sep?

if (options.origin === 'llm') {
const resolvedFile = path.resolve(outputDir, fileName);
if (!resolvedFile.startsWith(path.resolve(outputDir) + path.sep))
throw new Error(`Resolved file path for ${fileName} is outside of the output directory`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the directory name in the error message.

@pavelfeldman pavelfeldman merged commit 2f820cb into microsoft:main Sep 20, 2025
6 checks passed
renovate bot added a commit to izumin5210/dotfiles that referenced this pull request Sep 28, 2025
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs
from Renovate will soon appear from 'Mend'. Learn more
[here](https://redirect.github.com/renovatebot/renovate/discussions/37842).

This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [@playwright/mcp](https://playwright.dev)
([source](https://redirect.github.com/microsoft/playwright-mcp)) |
[`0.0.39` ->
`0.0.40`](https://renovatebot.com/diffs/npm/@playwright%2fmcp/0.0.39/0.0.40)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@playwright%2fmcp/0.0.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@playwright%2fmcp/0.0.39/0.0.40?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>microsoft/playwright-mcp (@&#8203;playwright/mcp)</summary>

###
[`v0.0.40`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.40)

[Compare
Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.39...v0.0.40)

##### Features

-
[microsoft/playwright@`c813e9c`](https://redirect.github.com/microsoft/playwright/commit/c813e9cf5)
feat(mcp): allow saving videos for sessions
[microsoft/playwright#37531](https://redirect.github.com/microsoft/playwright/issues/37531)

  ```bash
  ```

### video is saved from the creation of the page to the closure of the
context (browser\_close call).

npx [@&#8203;playwright/mcp](https://redirect.github.com/playwright/mcp)
--save-video=800x600

````
- microsoft/playwright@fff065816 feat(mcp): add --init-script option microsoft/playwright#37507
```bash

### the code in web-mocks.js will run on page initialization
npx @&#8203;playwright/mcp --init-script=./web-mocks.js
````

- [microsoft/playwright@`1313fbd`](https://redirect.github.com/microsoft/playwright/commit/1313fbd47) chore(mcp): introduce allowed-hosts [microsoft/playwright#37541](https://redirect.github.com/microsoft/playwright/issues/37541)

  ```bash
  ```

### Runs MCP server only accessible on 192.168.1.10, defense from DNS rebind

npx [@&#8203;playwright/mcp](https://redirect.github.com/playwright/mcp) --allowed-hosts=192.168.1.10:8080 --port=8080

```

##### Bugfixes
- microsoft/playwright@da333232e fix(mcp):
snapshot for ai fixes
microsoft/playwright#37527
- microsoft/playwright@499d084a5 fix(session):
an extra check for session log
microsoft/playwright#37508
- microsoft/playwright@2f820cb20 fix(mcp): lax
file path sanitization
microsoft/playwright#37502
```

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/izumin5210/dotfiles).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzAuMSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browser_screenshot tool saves to the incorrect file name

2 participants