function openid_profile_preprocess_user_picture(&$variables) {
$variables['picture'] = '';
if (variable_get('user_pictures', 0)) {
$account = $variables['account'];
if (!empty($account->picture) && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
// Add support for external user pictures
elseif (!empty($account->picture) && valid_url($account->picture)) {
$picture = $account->picture;
}
elseif (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
If you have a proper user picture, $account->picture is a file stdClass, not just a string, so you actually get a notice back:
Warning: file_exists() expects parameter 1 to be string, object given in openid_profile_preprocess_user_picture() (line 463 of sites/all/modules/contrib/openid_profile/openid_profile.module).
Warning: preg_match() expects parameter 2 to be string, object given in valid_url() (line 1148 of includes/common.inc).
Comments
Comment #1
Oleksa-1 commentedany solution how to get rid of this warning?
Comment #2
ijhaas commentedNo solution yet?
How can I make a string of $account->picture in file_exists($account->picture))
or is it better to replace file_exists() by is_file()
Comment #4
sanduhrsShould be fixed, thanks for reporting.