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

Paypal Zahlungsabwicklung
Seit kurzem funktioniert leider die Zahlung per paypal nichtmehr so wie sie soll...
0 Replies
Posted on Sunday, 26 June 2022
  • New
  • Matukip REST API
    Hi, I read in an old Changelog, that Matukio has a REST API, but I was unable t...
    0 Replies
    Posted on Thursday, 23 June 2022
    • #api
    Problem with map view
    Hi, we have problem with Map viewing, can you see this? https://zsbozp.vubp.cz/o...
    1 Replies
    Posted on Wednesday, 01 June 2022
    • #view
    custom checkbox field
    is there an option to add custom checkbox field that on the back-end we will che...
    5 Replies
    Posted on Monday, 13 June 2022
    Exporting Markers and Importing via PHPMyAdmin
    This is not a question, unless someone reading this knows a better way to do thi...
    4 Replies
    Posted on Monday, 22 July 2019
    • #Export
    • #import
    • #phpmyadmin
    • #markers