Merge pull request #3670 from monishdeb/CRM-14888
[civicrm-core.git] / CRM / Contact / Page / View.php
index ab40531cf709f4f65829ce064a4a2745a3a1394b..3fcbcd9f5f6a4d700f890f052b4b321e874ad1af 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -167,7 +167,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
         $image_URL = str_replace('http://', 'https://', $image_URL);
       }
 
-      list($imageWidth, $imageHeight) = getimagesize($image_URL);
+      list($imageWidth, $imageHeight) = getimagesize(CRM_Utils_String::unstupifyUrl($image_URL));
       list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
       $this->assign("imageWidth", $imageWidth);
       $this->assign("imageHeight", $imageHeight);
@@ -192,7 +192,9 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
     $this->assign('displayName', $displayName);
 
     $this->set('contactType', $contactType);
-    $this->set('contactSubtype', $contactSubtype);
+
+    // note: there could still be multiple subtypes. We just trimming the outer separator.
+    $this->set('contactSubtype', trim($contactSubtype, CRM_Core_DAO::VALUE_SEPARATOR));
 
     // add to recently viewed block
     $isDeleted = (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'is_deleted');