Skip to content

Refactor allowed functions to a dictionary for safety#2978

Merged
doomedraven merged 2 commits into
masterfrom
doomedraven-patch-4
Apr 20, 2026
Merged

Refactor allowed functions to a dictionary for safety#2978
doomedraven merged 2 commits into
masterfrom
doomedraven-patch-4

Conversation

@doomedraven
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves security by replacing the use of eval with a dictionary-based lookup for allowed functions within the parse_expr function. Feedback suggests moving the allowed_functions dictionary to a module-level constant to avoid redundant re-initialization during recursive calls, which would improve performance.

Comment thread web/submission/views.py Outdated
@doomedraven doomedraven merged commit e4e5f84 into master Apr 20, 2026
7 checks passed
@doomedraven doomedraven deleted the doomedraven-patch-4 branch April 20, 2026 06:24
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.

1 participant