Kunena 6.3.0 released

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

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 2.0, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Idea Kunena 2.0.4, Joomla 2.5.10, .htaccess and preview button

More
10 years 11 months ago #1 by Lightning88
Hello everybody,

Excuse-me for my english, i'm french. I post here, because i had a problem with preview button, when you click on this button, nothing appears.

This problem come on my data of htaccess 's files.

With this htaccess:

Warning: Spoiler!


You can see that i redirected www.e-infinity.fr/index.php to www.e-infinity.fr/ . This is for delete the duplicate content.

With Kunena, this is a problem. Because, when you click on preview button, the url ajax has this form:

www.e-infinity.fr/forum/reglement-du-for...yout=edit&format=raw

And return a 301 status code.

To work around this problem, this is a hack code:

In file : "/components/com_kunena/lib/kunena.bbcode.js.php" change line 27:
Code:
previewRequest = new Request.JSON({secure: false, url: <?php echo json_encode('index.php?option=com_kunena&view=topic&layout=edit&format=raw');?>,

to:
Code:
previewRequest = new Request.JSON({secure: false, url: <?php echo json_encode('/?option=com_kunena&view=topic&layout=edit&format=raw');?>,

And now, the url ajax has this form : www.e-infinity.fr/?option=com_kunena&vie...yout=edit&format=raw

I have changed index.php? to /?

And the preview button works perfectly without changed the htaccess file.

In the hope that it will help many people.

Geoffrey
The following user(s) said Thank You: Matias

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

More
10 years 11 months ago #2 by Matias
Good hint, but unfortunately we cannot take that into the official version as it breaks more sites than it fixes. :(

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

More
10 years 11 months ago #3 by Lightning88

Matias wrote: Good hint, but unfortunately we cannot take that into the official version as it breaks more sites than it fixes. :(


Thanks for your response, Matias.

This is a another solution:

In file : "/components/com_kunena/lib/kunena.bbcode.js.php" change line 27:
Code:
previewRequest = new Request.JSON({secure: false, url: <?php echo json_encode('index.php?option=com_kunena&view=topic&layout=edit&format=raw');?>,

to
Code:
previewRequest = new Request.JSON({secure: false, url: <?php echo json_encode(JURI::ROOT().'index.php?option=com_kunena&view=topic&layout=edit&format=raw');?>,

The method JURI::ROOT() return the root of URL. Here : www.e-infinity.fr/ and concat the rest of url. Because the url without this change has a this form:

www.e-infinity.fr/forum/reglement-du-for...yout=edit&format=raw

and not:

www.e-infinity.fr/index.php?option=com_k...yout=edit&format=raw

And i have changed the htaccess file:
Code:
RewriteCond %{REQUEST_URI} ^/index.(htm|html|php|asp)$ RewriteCond %{THE_REQUEST} /index.(htm|html|php|asp) RewriteRule ^(.*)index.(htm|html|php|asp)$ /$1 [R=301,L]

to
Code:
RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_URI} ^/index.(htm|html|php|asp)$ RewriteCond %{THE_REQUEST} /index.(htm|html|php|asp) RewriteRule ^(.*)index.(htm|html|php|asp)$ /$1 [R=301,L]

Just one condition which test if request method is POST is has adding:
Code:
RewriteCond %{REQUEST_METHOD} !=POST

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

More
10 years 11 months ago #4 by Matias
Well, we are generally using SEF URLs for all our POST requests, so you need to remove your rewrite condition in order to keep Kunena working.

In Kunena 3.0 we have gone even further: we are starting to enforce SEF URLs more and more and prevent all the requests coming to direct component URLs that are usually used by spam bots. We're not quite yet in there and the feature has been disabled by default, but there are many reasons not to expose those URLs to the attackers.

One of the best reasons is that if the component (or some part of it) has been "disabled" by administrator, I wouldn't want to give attackers a way to access the feature. For example if you disable login from your site, everyone can still access a known location of the login page.

The question is: why don't you want to use SEF on POST? People do not care about the URLs, so the only party who has a benefit are the attackers, who like to use known URLs for their attacks.

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

Time to create page: 0.480 seconds