1. teckhardt
  2. Bugs
  3. Thursday, 25 July 2013
  4.  Subscribe via email
Version 5.0rc2, default image not used due to bug on gravity "request"

[code type=diff]--- components/com_comment/helpers/avatars.php 2013-07-25 22:55:12.000000000 +0200
+++ components/com_comment/helpers/avatars.php-20130725 2013-07-25 22:54:29.000000000 +0200
@@ -52,7 +52,7 @@
$size = 64;
// Prepare the gravatar image
$path = "https://secure.gravatar.com/avatar.php?gravatar_id="; . md5(strtolower($email)) .
- "&default=" . urlencode($default) . "&s=" . $size;
+ "&default=" . urlencode($default) . "&s=" . $size;

return $path;
}[/code]
Responses (5)
Accepted Answer Pending Moderation
another mini:

[code type=diff]--- tmp/2/components/com_comment/templates/default/default_form.php 2013-06-11 15:07:44.000000000 +0200
+++ www/components/com_comment/templates/default/default_form.php 2013-07-26 20:52:09.000000000 +0200
@@ -153,7 +153,7 @@
<div class="span4 muted small">
<?php echo JText::_('COM_COMMENT_POSTING_AS'); ?>
<?php if ($user->guest) : ?>
- <button class="btn-link btn-small ccomment-posting-as">{{user.getName}}</button>
+ <button class="btn-link btn-small ccomment-posting-as"><?php echo JText::_('COM_COMMENT_ANONYMOUS'); ?></button>
<?php else : ?>
<span class="ccomment-posting-as">
<?php if ($this->config->get('layout.use_name', 1)) : ?>[/code]
  1. more than a month ago
  2. Bugs
  3. # 1
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Hey teckhardt,
Thanks for the fixes, but to be honest I don't understand them.

replacing & with & is in my eyes incorrect. In the source code of a page you should use & http://mrcoles.com/blog/how-use-amersands-html-encode/

And the second fix - {{user.getName}} calls the javascript function getName on the user class. If the user is anonymous, he can still set a name. Setting all users to have the name of "anonymous" when they are not logged in is incorrect.

Can you explain why are you trying to fix those parts?

Regards,
Daniel
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. Bugs
  3. # 2
Accepted Answer Pending Moderation
Hey teckhardt,
replacing & with & is in my eyes incorrect. In the source code of a page you should use & http://mrcoles.com/blog/how-use-amersands-html-encode/


The problem is that the ampersand is being encoded twice. I can confirm that I also had the same problem as teckhardt - the default image was not being picked up because the ampersand was encoded twice in the URL (and thus the characters 'amp;' were being interpreted as part of the parameter name). When I changed line 87 of avatars.php to use an unencoded ampersand, the default image was shown correctly (I didn't investigate at what point the 2nd encoding took place). Note that even if the default image fails, gravatar still sends its own default image (which is an ugly 'G' logo), so you still get an image anyway - just not the one specified.

To reproduce the problem, just install CComment on a fresh Joomla 3.2 site, add some comments using an email address that doesn't have a gravatar, and you will see the image is a 'G', NOT the 'mystery man' image that comes with CComment. If you view the generated source (using the web developer toolbar or something similar), it shows the ampersand is encoded twice (firebug only shows it encoded once - I guess it does a decode first). Changing line 87 of avatars.php to use an unencoded ampersand will cause the correct 'mystery man' image to appear. That might not be the correct solution (it might be better to find out where the 2nd encoding is taking place), but it does work!
  1. more than a month ago
  2. Bugs
  3. # 3
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
I see. The double encoding is most probably coming from the js replacement.
I changed the code - would you please test the dev. release and let me know if it works for you?
Since I work on localhost gravatar doesn't serve me any default image now...

Cheers,
Daniel
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. Bugs
  3. # 4
Accepted Answer Pending Moderation
Thanks for the fast response - yes, the dev release is working fine.
  1. more than a month ago
  2. Bugs
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

Changes to the Submission form
Can you make changes to the Submission form? There are a few fields I'd like to ...
0 Replies
Posted on Thursday, 18 April 2024
  • New
  • Questions on new installation...
    Working on getting this set up... https://eastend2024.joepolecheck.com/rumma...
    2 Replies
    Posted on Wednesday, 17 April 2024
  • New
  • Error received? Class "XMLReader" not fo
    Just installed the Pro version of Hotspots, but am getting an error when I try t...
    1 Replies
    Posted on Wednesday, 17 April 2024
  • Resolved
  • New
  • Links aus Veranstaltungsübersicht funktionieren ni
    Nach der Migration von Joomla 3.10 auf Joomla 5.0.3 treten folgende Probleme auf...
    2 Replies
    Posted on Monday, 08 April 2024
    Custom Hotspot Marker fails to load
    I just updated from Joomla 3 to Joomla 4.3.4 and Hotspots 6.0.12. I decided to e...
    0 Replies
    Posted on Tuesday, 09 April 2024