Merge pull request #5967 from colemanw/CRM-16632
[civicrm-core.git] / CRM / Core / Form.php
index 6441a57502e352f6997b110417323140cd101e66..76cc6ba2d1047fb2ab5c8114dcc5993c4d12ae4a 100644 (file)
@@ -1603,7 +1603,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
 
     $userID = $this->getLoggedInUserContactID();
 
-    if ($tempID == $userID) {
+    if (!is_null($tempID) && $tempID === $userID) {
       return (int) $userID;
     }
 
@@ -1621,7 +1621,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       return $tempID;
     }
 
-    return $userID;
+    return is_numeric($userID) ? $userID : NULL;
   }
 
   /**
@@ -1847,7 +1847,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
             if (!$options) {
               $targetField->setAttribute('placeholder', $targetField->getAttribute('data-none-prompt'));
             }
-          } 
+          }
           else {
             $targetField->setAttribute('placeholder', $targetField->getAttribute('data-empty-prompt'));
             $targetField->setAttribute('disabled', 'disabled');