From: Tim Otten Date: Fri, 11 Jul 2014 01:58:45 +0000 (-0700) Subject: CRM-14971 - Contact image URLs should go through WP frontend X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=065034510d48b722844b2007f8016ea644bd0cbd;p=civicrm-core.git CRM-14971 - Contact image URLs should go through WP frontend ---------------------------------------- * CRM-14971: Contact image URLs broken in WordPress after upgrade to 4.4.6 https://issues.civicrm.org/jira/browse/CRM-14971 --- diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 07f9ae2c0e..e7050a73d8 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -943,7 +943,7 @@ WHERE id={$id}; "; if (in_array($params[$imageIndex]['type'], $mimeType)) { $photo = basename($params[$imageIndex]['name']); - $params[$imageIndex] = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo='.$photo, TRUE); + $params[$imageIndex] = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo='.$photo, TRUE, NULL, TRUE, TRUE); return TRUE; } else { diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index 58d055ae46..5ef54705ab 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -348,7 +348,7 @@ AND image_URL IS NOT NULL $config = CRM_Core_Config::singleton(); $fullpath = $config->customFileUploadDir.$photo; if (file_exists($fullpath)){ - $newimageurl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo='.$photo, TRUE); + $newimageurl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo='.$photo, TRUE, NULL, TRUE, TRUE); $sql = 'UPDATE civicrm_contact SET image_url=%1 WHERE id=%2'; $params = array( 1 => array($newimageurl, 'String'),