Kunena 7.0.5 & Kunena 6.4.11 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.5 [K 7.0.5] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0.

The Kunena team is also pleased to announce the eleventh version of Kunena 6.4, a native Joomla extension for Joomla! 5.0, 5.1, 5.2, 5.3, 5.4 and 6.0.

Question Hide BBCode [URL] for non registered users

  • C0n
  • C0n's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Only the strongest will survive
More
15 years 7 months ago - 15 years 7 months ago #62585 by C0n

@quila wrote: Hi Milutin,

replace the file kunena.parser.php

components / com_kunena / lib /

with this one attached. This hack hide all link in the post from unregistered user.

File Attachment:

File Name: kunena-20091006.zip
File Size:10.55 KB


Kunena 1.5.6

etusha wrote

will be good if u add this hack at KUNENA 1.5.7 ( by default )


yes will be good but there is a problem if someone want to show link.
In that case we need to have possibility to choose in the configuration, but this is for K1.6 ;)


Thanks quila for this example code i took a look and studdied it for a bit and then compared it to the current kunena 1.5.12 code and relised how you were making it invisible to unregistered users.
Code:
$kunena_my = &JFactory::getUser(); if ($kunena_my->id==0) { // Hide between content from non registered users } else { // The code for the url tags to be displayed }
Last edit: 15 years 7 months ago by C0n.

Please Log in or Create an account to join the conversation.

  • C0n
  • C0n's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Only the strongest will survive
More
15 years 7 months ago - 15 years 7 months ago #62587 by C0n
Although i already found a bug with both sources :p that this will only work on url links that have been wrapped in url tags
Code:
[url][/url]
if its not been wrapped in url tags and it just uses www.domain.com then it is still visible to guest users :O ^_^ :silly:
Last edit: 15 years 7 months ago by C0n.

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #87575 by Newkun
Hi, isn't there any solution for hiding all of links other than hack files? Can't you put a setting about this in backend in new releases or do you plan this?

If there is no solution still,Can i learn whether does the solution work for Kunena 1.6.3 which was suggested by @quila?

thanks in advance

Please Log in or Create an account to join the conversation.

More
15 years 1 month ago - 15 years 1 month ago #91141 by Alexey

C0n wrote: Although i already found a bug with both sources :p that this will only work on url links that have been wrapped in url tags

Code:
[url][/url]
if its not been wrapped in url tags and it just uses www.domain.com then it is still visible to guest users :O ^_^ :silly:


to hide this one see kunena.parser.php near 320 line and
Code:
$tns = '<a href="' . kunena_htmlspecialchars ( $tempstr, ENT_QUOTES ) . '" rel="nofollow" target="_blank">'; $tne = '</a>';

change to
Code:
$kunena_my = &JFactory::getUser(); if ($kunena_my->id==0) { // Hide between content from non registered users $tns = ''; $tne = ''; } else { $tns = '<a href="' . kunena_htmlspecialchars ( $tempstr, ENT_QUOTES ) . '" rel="nofollow" target="_blank">'; $tne = '</a>'; }

also

see near 68 line:
Code:
$text = preg_replace ( '/(?<!S)((http(s?):\/\/)|(www\.[a-zA-Z0-9-_]+\.))+([a-zA-Z0-9\/*+-_?&;:%=.,#]+)/u', '<a h ref="http$3://$4$5" target="_blank" rel="nofollow">$4$5</a>', $text );

change to
Code:
$kunena_my = &JFactory::getUser(); if ($kunena_my->id==0) { // Hide between content from non registered users $text = preg_replace ( '/(?<!S)((http(s?):\/\/)|(www\.[a-zA-Z0-9-_]+\.))+([a-zA-Z0-9\/*+-_?&;:%=.,#]+)/u', '['.JText::_('COM_KUNENA_A_REGISTERED_ONLY') .']', $text ); } else { // The code for the url tags to be displayed $text = preg_replace ( '/(?<!S)((http(s?):\/\/)|(www\.[a-zA-Z0-9-_]+\.))+([a-zA-Z0-9\/*+-_?&;:%=.,#]+)/u', '<a href="http$3://$4$5" target="_blank" rel="nofollow">$4$5</a>', $text ); }
Last edit: 15 years 1 month ago by Alexey.
The following user(s) said Thank You: supersasho

Please Log in or Create an account to join the conversation.

More
15 years 1 month ago - 15 years 1 month ago #91150 by supersasho
I edited the previous post i wrote here. I left a line "return TAGPARSER_RET_REPLACED;" so it didn't work for me. Right now it works and i can only say THANK YOU!!
Last edit: 15 years 1 month ago by supersasho. Reason: a made a mistake

Please Log in or Create an account to join the conversation.

Time to create page: 0.249 seconds