Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

[BUG] +[PATCH] - Bad redirection
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: [BUG] +[PATCH] - Bad redirection

[BUG] +[PATCH] - Bad redirection 15 years, 8 months ago #4811

  • rsd
  • OFFLINE
  • Posts: 8
Hi,

Some times, Joomsef will try to redirect nonSEF URLs to SEF urls (if this option is on) but it does not check if the
"SEF" url is the same as the non-SEF original one.
Then this will cause a loophole of infinite redirections.

This patch solves this problem:

diff -Nru com_joomsef-2.3.0-orig/joomsef.php com_joomsef-2.3.0-rsd1/joomsef.php
--- com_joomsef-2.3.0-orig/joomsef.php 2008-08-05 14:49:50.000000000 -0300
+++ com_joomsef-2.3.0-rsd1/joomsef.php 2008-08-29 23:57:56.000000000 -0300
@@ -38,7 +38,7 @@
{
$lnk = sefRelToAbs(str_replace($base, '', $_SERVER['REQUEST_URI']));
 
- if( strpos($lnk, 'index.php?') === false ) {
+ if( strpos($lnk, 'index.php?') === false && ($_SERVER['REQUEST_URI'] !== $base . $lnk) ) {
// Seems the URL is SEF, let's redirect
$f = $l = '';
if (!headers_sent($f, $l)) {
 

Re:[BUG] +[PATCH] - Bad redirection 15 years, 8 months ago #4812

  • rsd
  • OFFLINE
  • Posts: 8
Forgot to mention that this was only tested on 2.3.0 on J! 1.0.x, but I believe 3.0.x might have the same problem too.

-rsd
  • Page:
  • 1
User Login Empty