-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
validate resource's integrity before using it #14883
Conversation
7176a92
to
39d9023
Compare
@georgehrke looks like you missed the memo: b533aad#diff-6a3371457528722a734f3c51d9238c13 🙊 please add a unit test - THX |
Missed that 🙈 |
thx |
39d9023
to
1a5de00
Compare
Refer to this link for build results (access rights to CI server needed): |
👍 |
*/ | ||
function data() { | ||
if (!is_resource($this->resource)) { | ||
$this->logger->debug('OC_Image->data. Not a resource', array('app' => 'core')); |
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.
debug messages like this (and others in this file) are basically of 0 use. One has no idea on which file this happened.
I'd vote for dropping - having no resource loaded is a valid case.
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.
I'll remove it
THX @georgehrke for the unit test - and here: have come 🍰 and 🍻 - Happy birthday! |
Thx 😃 |
1a5de00
to
4556d11
Compare
*/ | ||
function data() { | ||
if (!is_resource($this->resource)) { |
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.
Having a closer look - calling valid() here might be a better idea - just in case we ever have to add further validations.
https://github.com/owncloud/core/blob/master/lib/private/image.php#L80
4556d11
to
09b0537
Compare
Refer to this link for build results (access rights to CI server needed): |
The inspection completed: 1 updated code elements |
👍 |
validate resource's integrity before using it
@DeepDiver1975 Do we want to back port this? |
should not hurt - please open a pr against stable8 - THX |
backport pr: #14917 |
fixes #14036
please review @oparoz @MorrisJobke