Bind reward JavaScript placeholders as data - #302
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
fda8fa8 to
0668d44
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0668d44b75
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b4fb730b4
ℹ️ 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".
4bcd709 to
4c012e9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fed11f9f39
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ab21d78d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36d75a5fd9
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04f9f6e5e1
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26429e5ca2
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3561f097de
ℹ️ 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".
| if ("([{:;,=!?&|+-*%^~<>".indexOf(previous) >= 0) { | ||
| return true; |
There was a problem hiding this comment.
Reject postfix updates before treating slash as regex
When Nashorn parsing falls back but the active engine supports modern syntax, a slash following ++ or -- is treated as the start of a regex because the immediately preceding +/- is accepted here. Fresh evidence beyond the earlier division thread is obj?.x; a++ / %count% / 2: the scanner creates a false regex range, so a value such as 2.5 is inserted as 2\.5 rather than bound and the valid division expression becomes invalid. Check for postfix update operators before allowing these characters to start a regex.
Useful? React with 👍 / 👎.
|
Superseded by #303. The replacement starts cleanly from #303 also replaces the handwritten modern-JavaScript fallback scanner with Rhino AST classification inside known JavaScript blocks, while preserving automatic legacy placeholder handling. Java CI is green on the replacement's single-commit head. |
|
Closing this approach as superseded. The replacement will start from current |
Summary
JavascriptEnginePlayer.hasPermission("someper") == truecontinue to run as-is%placeholder%values and AdvancedCore%name%/{name}custom placeholders anywhere JavaScript is evaluated[Javascript=...]marker in the same processing pathAutomatic compatibility
No JavaScript configuration changes should be required. Placeholder handling happens inside
JavascriptEngine, so callers do not need to remember a separate preprocessing step.Examples that remain valid:
Security boundary
Operator-authored JavaScript remains executable code. PlaceholderAPI/reward/custom placeholder output is treated as data and cannot change the JavaScript program structure. Expression values are engine-bound; values inside existing string/template/regex literals are escaped for that literal context.
This supersedes #293 without carrying forward its handwritten JavaScript lexer.