Skip to content

Conversation

@kishore6778
Copy link

Summary of Changes

This pull request fixes 6 critical bugs in the main.py file:

BUG 1: HTML Escaping Order
Fix: Reordered replace() statements in html_escape() function
Issue: Ampersand replacement was happening before other HTML entities, causing double-escaping
-impact: Prevents unintended HTML entity duplication

BUG 2-4: Email Configuration and Type Conversion
-Fix: Added type conversion for email_smtp_port from string to integer with null checking

  • Fix: Changed unsafe dict access CONFIG["key"] to CONFIG.get("key", default)
  • Issue: Port values retrieved as strings but used in numeric comparisons
  • Impact: Prevents ValueError and TypeError exceptions

BUG 5-6: Type Checking in matches_word_groups()
Fix: Added isinstance() checks for filter_word, req_word, and normal_word
Issue: String methods like .lower() were called without verifying type
Impact: Prevents AttributeError when non-string types are passed

Testing
All changes maintain backward compatibility and preserve existing functionality. i hope it helps

sansan0 and others added 30 commits June 13, 2025 19:21
sansan0 and others added 29 commits November 8, 2025 20:27
…tements in html_escape function so that ampersand replacement happens last, preventing double-escaping.
…hecking BUG sansan0#2-4: Added type conversion for email_smtp_port from string to integer with null checking before conversion. Fixed unsafe dictionary access. BUG sansan0#5-6: Added type checking in matches_word_groups() function for filter_word, req_word, and normal_word to prevent AttributeError when calling .lower() on non-string types.  Fixes ValueError, TypeError, and AttributeError exceptions
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.

6 participants