Reset onerror on images if placeholder does not exist to prevent from requests storm

pull/5838/head
Aleksander Machniak 8 years ago
parent 8131629c6e
commit 01031d0ced

@ -860,7 +860,7 @@ function rcmail_contact_photo($attrib)
$content = html::div($attrib, html::img(array(
'src' => $photo_img,
'alt' => $RCMAIL->gettext('contactphoto'),
'onerror' => 'this.src = rcmail.env.photo_placeholder',
'onerror' => 'this.src = rcmail.env.photo_placeholder; this.onerror = null',
)));
if ($CONTACT_COLTYPES['photo'] && ($RCMAIL->action == 'edit' || $RCMAIL->action == 'add')) {

@ -336,7 +336,7 @@ function rcmail_message_contactphoto($attrib)
'_email' => $MESSAGE->sender['mailto'],
));
$attrib['onerror'] = "this.src = '$placeholder'";
$attrib['onerror'] = "this.src = '$placeholder'; this.onerror = null";
}
else {
$photo_img = $placeholder;

@ -353,7 +353,7 @@ function rcmail_user_prefs($current = null)
'alt' => $skin,
'width' => 64,
'height' => 64,
'onerror' => "this.src = rcmail.assets_path('program/resources/blank.gif')",
'onerror' => "this.src = rcmail.assets_path('program/resources/blank.gif'); this.onerror = null",
));
$skinnames[] = mb_strtolower($skinname);

Loading…
Cancel
Save