Make sure $attr[0] is set before referencing it.

This commit is contained in:
Gerhard Potgieter 2018-07-19 11:36:44 +02:00
parent a26530f84a
commit dda30061f7
1 changed files with 1 additions and 1 deletions

View File

@ -455,7 +455,7 @@ add_action( 'woocommerce_scheduled_sales', 'wc_scheduled_sales' );
* @return array
*/
function wc_get_attachment_image_attributes( $attr ) {
if ( strstr( $attr['src'][0], 'woocommerce_uploads/' ) ) {
if ( isset( $attr[0] ) && strstr( $attr['src'][0], 'woocommerce_uploads/' ) ) {
$attr['src'][0] = wc_placeholder_img_src();
}
return $attr;