Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip perplexity2 #21

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

wip perplexity2 #21

wants to merge 33 commits into from

Conversation

jpan8866
Copy link

Description ✏️

Closes #xxx

What changed? Feel free to be brief.

  • Bullet points are helpful.
  • Screenshots are helpful (if applicable).

Checklist ✅

  • I have added screenshots (if UI changes are present).
  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).


const escapeDollarSigns = (text: string | undefined) => {
if (!text) return "Aider response over";
return text.replace(/\$/g, "\\$");

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Copilot Autofix AI about 11 hours ago

To fix the problem, we need to ensure that backslashes are also escaped in the escapeDollarSigns function. This can be achieved by first replacing backslashes with double backslashes and then replacing dollar signs with escaped dollar signs. This ensures that both backslashes and dollar signs are properly escaped.

  • Modify the escapeDollarSigns function to handle backslashes by adding an additional replace operation.
  • Ensure that the function uses regular expressions with the g flag to replace all occurrences of the characters.
Suggested changeset 1
core/llm/llms/Aider.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/core/llm/llms/Aider.ts b/core/llm/llms/Aider.ts
--- a/core/llm/llms/Aider.ts
+++ b/core/llm/llms/Aider.ts
@@ -345,3 +345,3 @@
       if (!text) return "Aider response over";
-      return text.replace(/\$/g, "\\$");
+      return text.replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
     };
EOF
@@ -345,3 +345,3 @@
if (!text) return "Aider response over";
return text.replace(/\$/g, "\\$");
return text.replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
};
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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.

2 participants