From 8676e8d177d7319c1e58f405c1725801f85faf33 Mon Sep 17 00:00:00 2001 From: fauguste Date: Thu, 15 Oct 2015 17:49:31 +0200 Subject: [PATCH] bug url comparaison : origin url and target url We are using question2answer with wordpress and qtranslatex 3.4.6.2. We are using rewrite rules on question2answer : ```` RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L] ```` We have an infinity of redirection on question2answer when qtranslatex is activated . The problem is on these values : $url_orig = https://www.exemple.com/fluks/qa/search?q=frfr $url_lang = https://www.exemple.com/fluks/qa/search?qa-rewrite=search&q=frfr We solved this problem with this modification --- qtranslate_core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtranslate_core.php b/qtranslate_core.php index c78f4ab..019fb09 100644 --- a/qtranslate_core.php +++ b/qtranslate_core.php @@ -70,7 +70,7 @@ function qtranxf_init_language() { if( $q_config['url_info']['doing_front_end'] && qtranxf_can_redirect() ){ $lang = $q_config['language']; $url_orig = $url_info['scheme'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; - $url_lang = qtranxf_convertURL('',$lang);//uses $q_config['url_info'] and caches information, which will be needed later anyway. + $url_lang = qtranxf_convertURL($url_orig,$lang);//uses $q_config['url_info'] and caches information, which will be needed later anyway. if(!isset($url_info['doredirect']) && $url_orig != $url_lang){ $url_info['doredirect'] = '$url_orig != $url_lang'; }