-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sanitize tag, item, and mod inputs #54
Conversation
special/OreDictEntryManager.php
Outdated
if ($result == false) { | ||
return -2; | ||
} | ||
return $result; |
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.
Is ? : a thing in PHP?
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.
Also loosely checking against false in PHP, while rare, could end in disaster.
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.
Come to think about it, in Java the syntax would be !$results although I suspect that's not a possible thing in PHP.
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.
return ($result === false ? -2 : $result);
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.
@Alexia Is that check loose? I thought === false
would be "loose" while == false
would be strictly checking against false
.
OreDict#addEntry
returns either false
or the entry ID. Is this a poor way to handle this?
Edit: Never mind, Peter corrected me. I had it flipped around in my head.
This seems fine to me. |
Close #53.
@Alexia Could you review this and perhaps double check that I haven't missed any areas where input sanitation is needed?