{"id":1576,"date":"2008-03-24T17:13:36","date_gmt":"2008-03-24T22:13:36","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=1576"},"modified":"2008-03-24T17:22:07","modified_gmt":"2008-03-24T22:22:07","slug":"wavatars-debugging","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=1576","title":{"rendered":"Wavatars: Debugging"},"content":{"rendered":"<p>Okay, about a dozen people have emailed me over the last few months to tell me my code is wrong.  Which is true. The line in question is where I make the URL for the gravatar.  <\/p>\n<p>I do it thus:<\/p>\n<p><code>gravatar_id=$md5.jpg&;r=$rating&;s=$size&;d=$url<\/code><\/p>\n<p>The important thing being that the fields have an ampersand, followed by a semicolon.  The API calls for just an ampersand.  So my code is &#8220;wrong&#8221;, except that it <strong>works<\/strong>.  If I use &#8220;correct&#8221; code:<\/p>\n<p><code>gravatar_id=$md5.jpg&amp;amp;rating=$rating&amp;amp;size=$size&amp;amp;d=$url<\/code><\/p>\n<p>It breaks. Wavatars show up, but Gravatars do not. Everyone shows up as a wavatar.<\/p>\n<p>Other people report the opposite: My code breaks, the correct code works as it should.  It&#8217;s pissing me off, because I don&#8217;t have the time or the patience to sort out this nonsense, which (I&#8217;m guessing) comes from differing versions of PHP.  To really fix the problem, I have to figure out what PHP options or versions are causing the different behavior, check for them, and use the different versions of the URL based on those values.  I could sink a lot of hours into a fishing expedition like that, and I just don&#8217;t have them right now.<\/p>\n<p>Having said that, if anyone has a guess, please drop a comment.  <\/p>\n<p><strong>LATER:<\/strong> Perhaps it&#8217;s not related to PHP versions.  I found a case where leaving the &#8220;ratings&#8221; blank would cause my code to work, and filling it in would cause the correct code to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay, about a dozen people have emailed me over the last few months to tell me my code is wrong. Which is true. The line in question is where I make the URL for the gravatar. I do it thus: gravatar_id=$md5.jpg&#038;;r=$rating&#038;;s=$size&#038;;d=$url The important thing being that the fields have an ampersand, followed by a semicolon. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1576","post","type-post","status-publish","format-standard","hentry","category-projects"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/1576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1576"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/1576\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}