Skip to content
This repository was archived by the owner on Nov 6, 2026. It is now read-only.

Improve escaping in HasCastable.php - #44

Merged
andrey-helldar merged 1 commit into
mainfrom
andrey-helldar-patch-3
Nov 6, 2026
Merged

andrey-helldar merged 1 commit into
mainfrom
andrey-helldar-patch-3

Conversation

@andrey-helldar

Copy link
Copy Markdown
Member

No description provided.

@andrey-helldar andrey-helldar added the bug Something isn't working label Nov 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T15:44:17.816418Z 2b346ee PR opened
🔒 Security Review 🔄 Running since 2026-11-06T15:43:11.491913Z 2b346ee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@andrey-helldar
andrey-helldar merged commit 6db094d into main Nov 6, 2026
12 of 14 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b346eefc2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

return "'" . addslashes($value) . "'";
return "'" . str_replace(['\\', "'"], ['\\\\', "\\'"], stripslashes($value)) . "'";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve literal backslashes before escaping string values

When an input string contains literal backslashes, stripslashes($value) removes them before the replacement can escape them. For example, C:\temp\file.txt becomes 'C:tempfile.txt', and App\Models\User becomes 'AppModelsUser'. The PHP formatter passes original array values directly to castValue(), so these are not previously escaped strings that need decoding. This silently corrupts paths, class names, and other backslash-containing values in the generated PHP. Remove the stripslashes() call and escape the original value directly.

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant