-
-
Notifications
You must be signed in to change notification settings - Fork 409
abstract_backends: safe() all prepare_command args #2368
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
Conversation
dgw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it was a silly pattern. You've done what I hadn't gotten around to yet (irl business / busy-ness). ![]()
(Haven't looked for missed calls to safe() because of the janky review setup I'm using tonight, as mentioned on IRC. For that reason I'll wait to merge until either someone else takes a look or I get to a proper PC setup to take another look-see myself.)
894b815 to
ca7f901
Compare
|
Thanks for the reminder to check other files for safe()s - the args= one is fine to remove, and I think the recipients one is okay but another pair of eyes would be good, I'm not confident I'm following what's going on there fully. |
I'm not convinced it's good to remove @Exirel Any thoughts on this bit? I know you already approved (and so did I), but we hadn't noticed/thought of this detail before. |
|
I think we can keep the |
|
I had a think about putting In the future (post-8.0) we should consider making the IRC pipeline convert messages to a custom data type (possibly subclass of That's a whole separate discussion that I don't want to start just yet, though. For now I will close and reopen the PR, which will |
Description
We previously had a silly pattern of calling safe() for most (but not all!) arguments passed to send_command. This is usually not an issue since the contents are either not user-generated or must be sent through IRC (so cannot contain
\r\n), but sometimes that's not the case, especially for privmsg/notice. Some plugins may also call send_command directly. Let's just pre-empt the whole class of potential problems by safe()ing all args inprepare_command().Supersedes #2356. Thanks to @semarie for finding this issue.
Checklist
make qa(runsmake qualityandmake test)