public function maybe_encode_get_image_tag($html, $id, $alt, $title, $align, $size)
{
if (!($s3object = $this->is_attachment_served_by_s3($id))) {
// Not served by S3, return
return $html;
}
preg_match('@\\ssrc=[\'\\"]([^\'\\"]*)[\'\\"]@', $html, $matches);
if (!isset($matches[1])) {
// Can't establish img src
return $html;
}
$img_src = $matches[1];
$new_img_src = $this->maybe_sign_intermediate_size($img_src, $id, $size, $s3object);
$new_img_src = $this->encode_filename_in_path($new_img_src);
return str_replace($img_src, $new_img_src, $html);
}