Skip to content

apply_corrections.py 1.4: fixing bug #359 using regex module#599

Open
lei-json wants to merge 2 commits intoweechat:mainfrom
lei-json:main
Open

apply_corrections.py 1.4: fixing bug #359 using regex module#599
lei-json wants to merge 2 commits intoweechat:mainfrom
lei-json:main

Conversation

@lei-json
Copy link
Copy Markdown

@lei-json lei-json commented Apr 10, 2026

Script info

  • Script name:  apply_corrections.py
  • Version:  1.4
  • Requirements:  regex (Python module)
  • Min WeeChat version: 
  • Script tags: 

Description

Replace usage of the standard re module with the regex module in
get_corrected_messages to prevent CPU hangs caused by catastrophic backtracking when processing complex or malicious patterns.

Checklist (new script)

  • Single commit, single file added
  • Commit message: New script name.py: short description…
  • No similar script already exists
  • Name: max 32 chars, only lower case letters, digits and underscores
  • Unique name, does not already exist in repository
  • No shebang on the first line
  • Comment in script with name/pseudo, e-mail and license using SPDX tags (see Contributing guide)
  • Only English in code/comments
  • Pure WeeChat API used, no extra API
  • Function hook_url, hook_process or hook_process_hashtable is used for any blocking call
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

Checklist (script update)

  • Author has been contacted
  • Single commit, single file added
  • Commit message format: script_name.py X.Y: …
  • Script version and Changelog have been updated
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

Checklist (script deletion)

  • Author has been contacted
  • Single commit, single file deleted
  • Commit message format: Remove script name.py with reasons in description

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