-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Conversation
any feedback on this? |
Thanks! |
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.
Silently deleting the image seems like unexpected behavior. I added a couple other things that might be updated if this strategy sticks. Thoughts?
$success = curl_exec($ch) || curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200; | ||
|
||
if ($success){ | ||
fclose($fp); |
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.
Shouldn't this happen regardless of success?
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.
true
curl_close($ch); | ||
fclose($fp); | ||
} elseif (ini_get('allow_url_fopen')) { |
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.
Shouldn't the same checks go here in case curl
isn't enabled?
if lorempixel is not available then the image is saved as spoiled, 0 kb, so there is no need to store it |
Yeah, I get that much. But if I expect all my images to be generated, some are inexplicably missing, and I'm not versed in the intricacies of this issue, what do I do? |
in my opinion its a good catch to add additional check in your code
|
But once again, if I'm a user who has no idea this is an issue, how would I know to do that? I certainly don't do anything like:
|
fix broken image if service unavailable