Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] 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

Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Important bug: internal URL link rendered wrong in post in Kunena 1.7.0

More
14 years 7 months ago - 14 years 7 months ago #107469 by baijianpeng
Before I upgrade to Kunena 1.7.0, my forum (kunena v1.6.5) works fine, it can render the internal URL link correctly.

Recently I upgraded to Kunena v1.7.0 and this function now can NOT work any more.

For example, I entered a link with BBcode when posting:
Code:
[url=index.php?option=com_remository&Itemid=48&func=fileinfo&id=875]Maxi Menu CK 菜单模块[/url]

You can see that this is a standard internal link of Joomla, a relative URL started with index.php? , but this code will get following result after I submit this post:

That link will point to:
Code:
http://index.php/?option=com_remository&Itemid=48&func=fileinfo&id=875

What is wrong?

Kunena should pre-pend my domain to the relative link I input there, but it did not, and interpreted the "index.php" part as the domain ( it assumes that "index.php" like "kunena.org"), what a big bug!

Hope you will fix this soon.

Thanks.

www.joomlagate.com/

Chinese Joomla Users' Portal
Last edit: 14 years 7 months ago by baijianpeng.
The following user(s) said Thank You: xillibit

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

More
14 years 7 months ago - 14 years 7 months ago #107600 by Matias
Relative URLs are issue in Joomla as Kunena cannot know if index.php is in:
/index.php
/administrator/index.php
/forum/index.php
/joomla/index.php
...

Old code worked without starting slash -- as long as you didn't have SEF enabled. If you had SEF, it failed hard, so I decided to fix it. Your use case is special one as it is possible to guess what the user meant, but I missed it.. :(

You should use absolute URLs instead:
Code:
[url=/index.php?option=com_remository&Itemid=48&func=fileinfo&id=875]Maxi Menu CK 菜单模块[/url]

Or fix the issue by editing components/com_kuenna/lib/kunena.parser.php
line 307 (add "index.php|" into regexp):
Code:
if (! preg_match ( "`^(/|index.php|https?://)`", $tempstr )) {
line 425 (do the same):
Code:
if (! preg_match ( "`^(/|index.php|https?://)`", $tempstr )) {
Last edit: 14 years 7 months ago by Matias.

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

More
14 years 7 months ago #108142 by baijianpeng
Sorry for delayed reply, I did not got the notification email about your reply.

Your hack works fine. I hope you will add this hack to Kunena code in next release.

Using absolute URL (start with slash) is not a good idea, because sometimes if you restore a backup of remote site on your localhost machine (localhost server always use subfolder to install Joomla), you will find all those absolute URLs wrong.

Thanks for your help.

www.joomlagate.com/

Chinese Joomla Users' Portal

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

More
14 years 6 months ago #108659 by baijianpeng
new update:

If I use SEF format relative URL for BBcode link, it will render error result.

For example:

I input
Code:
[url=forum/topic-41713]link text here[/url]

That link will point to:
Code:
http://forum/topic-41713/

So I think, this RegEx rule is not good.

A better rule is : if the user input a URL without http:// or https:// or ftp:// , then it should be treated as relative URL and pre-pend the current domain name when rendering the post after submission.

Thanks.

www.joomlagate.com/

Chinese Joomla Users' Portal

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

Time to create page: 0.253 seconds