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

migrate freezes after moving 56 out of 220 article
Hello, CMigrator migrate function is freezing after moving 56 articles from t...
8 Replies
Posted on Saturday, 28 January 2023
  • New
  • Issue in displaying map
    Hi I am having and issue with the display of the map. I did all the process wi...
    19 Replies
    Posted on Tuesday, 20 September 2022
    zusätzliche Buchungsfelder in Teilnehmerliste bei
    Hallo liebes Entwicklerteam, ich komme mal wieder nicht weiter bei meinem Probl...
    7 Replies
    Posted on Saturday, 21 January 2023
    Submission form doesn't send data to database or w
    I don't know if this is a bug, but the submission form all of a sudden, maybe af...
    9 Replies
    Posted on Monday, 23 January 2023
  • New
    • #custom fields
    • #submission form,
    plötzlich alles in englisch
    seit ein paar Tagen ist bei mir das ganze Matukio auf englisch. Ich hab keine A...
    3 Replies
    Posted on Saturday, 28 January 2023
  • New