get_avatar() returns an url with #038; instead of &
-
In the latest WordPress something has changed in the get_avatar() function because the output has changed and it’s no longer correct. Note that in 4.1.x everything was just fine.
Now when i call the function get_avatar like this:$astring = get_avatar($author,$size);
I get this as output:
<img alt='' src='https://2.gravatar.com/avatar/5ccf704664de0bbc2b633b2e550a1e1a?s=100&d=wavatar&r=g' srcset='https://2.gravatar.com/avatar/5ccf704664de0bbc2b633b2e550a1e1a?s=200&d=wavatar&r=g 2x' class='avatar avatar-100 photo' height='100' width='100' />
as you can see the url in src has “&” instead of “&”. Instead the url in srcset it’s correct.
Why does this happen? Am I doing something wrong? It’s a WordPress bug?
I have temporarily fixed the problem with a preg_replace but it don’t like it as a permanent solution.EDIT: sadly for some reason the support forum replaces & with & in the code block (really funny) so you can’t see of what I am talking about. Just take a look at this screenshot please.
- The topic ‘get_avatar() returns an url with #038; instead of &’ is closed to new replies.