Support » Plugin: Social Author Bio » Error in google_avatar function

  • Resolved robertmeffe

    (@robertmeffe)


    If you have “allow_url_fopen = 0” when viewing your author page you will get an error.

    I updated the function as follows if you want to commit it.

    function google_avatar( $id ) {
    		if(ini_get('allow_url_fopen') == 1)
    		{
    			$headers = get_headers("https://profiles.google.com/s2/photos/profile/".$id."?sz=48", 1);
    			$PicUrl = $headers['Location'];
    		} else {
    			$curl = curl_init();
    			curl_setopt_array( $curl, array(CURLOPT_RETURNTRANSFER => true,	CURLOPT_URL => "https://profiles.google.com/s2/photos/profile/".$id."?sz=48" ) );
    			curl_exec( $curl );
    			$response_code = curl_getinfo( $curl, CURLINFO_EFFECTIVE_URL );
    			curl_close( $curl );
    		}
    		return $PicUrl;
    	}

    http://wordpress.org/extend/plugins/social-autho-bio/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Error in google_avatar function’ is closed to new replies.