This code in inc/class-tachyon.php. Can cause warnings.
$src_per_wp = wp_get_attachment_image_src( $attachment_id, $size );
if ( self::validate_image_url( $src_per_wp[0] ) ) {
$src = $src_per_wp[0];
$fullsize_url = true;
...
If the return from wp_get_attachment_image_src is false, which it can be, the code should not continue as if it got the array of image data.
The call to validate_image_url generates a warning:
"Trying to access array offset on value of type bool"
and then the first line in validate_image_url generates another warning:
"parse_url(): Passing null parameter #1 ($url) of type string is deprecated"
I don't understand how the $attachement_id might be invalid, or reference an invalid image, but we know this does happen in the wild.
Acceptance Criteria
For Altis Team Use
Ready for Work Checklist
Is this ticket ready to be worked on? See
the Play Book Definition of Ready
Completion Checklist
Is this ticket done? See
the Play Book Definition of Done
This code in inc/class-tachyon.php. Can cause warnings.
If the return from
wp_get_attachment_image_srcisfalse, which it can be, the code should not continue as if it got the array of image data.The call to
validate_image_urlgenerates a warning:"Trying to access array offset on value of type bool"
and then the first line in
validate_image_urlgenerates another warning:"parse_url(): Passing null parameter #1 ($url) of type string is deprecated"
I don't understand how the $attachement_id might be invalid, or reference an invalid image, but we know this does happen in the wild.
Acceptance Criteria
For Altis Team Use
Ready for Work Checklist
Is this ticket ready to be worked on? See
the Play Book Definition of Ready
Completion Checklist
Is this ticket done? See
the Play Book Definition of Done
backportlabels been added to the PR?