WordPress.org

Ready to get started?Download WordPress

Forums

qTranslate slug with widget
[resolved] v0.5 & WP3.3.2 double slash problem (4 posts)

  1. scrp
    Member
    Posted 2 years ago #

    WordPress 3.3.2
    qtranslate-slug-with-widget 0.5
    qTranslate 2.5.28

    Problem: menu link to page, selected as front page, appears with double slash after domain name.

    i.e.: http://www.domain.com//some-front-page

    http://wordpress.org/extend/plugins/qtranslate-slug-with-widget/

  2. scrp
    Member
    Posted 2 years ago #

    Solved. Small fix:

    Go to line 328 ( file qtranslate-slug-with-widget.php )

    Find lines:

    // & workaround
    $complete = str_replace('&','&',$home."/".$url);

    and in front of these two lines add add small fix:

    $url = ltrim(str_replace('//', '/', $url),"/");
    // & workaround
    $complete = str_replace('&','&',$home."/".$url);
  3. Pedro Carvalho
    Member
    Posted 2 years ago #

    ahhh! thanks scrp!

  4. kaisersauzee75
    Member
    Posted 1 year ago #

    I follow all scrp suggestions, but doesn't work!
    That's my code from line 337 of qtranslate-slug-with-widget.php:

    // see if cookies are activated
    	if(!$q_config['cookie_enabled'] && !$q_config['url_info']['internal_referer'] && $urlinfo['path'] == '' && $lang == $q_config['default_language'] && $q_config['language'] != $q_config['default_language'] && (isset($q_config['hide_default_language'])?$q_config['hide_default_language']:true)) {
    		// :( now we have to make unpretty URLs
    		$url = preg_replace("#(&|\?)lang=".$match[2]."&?#i","$1",$url);
    		if(strpos($url,'?')===false) {
    			$url .= '?';
    		} else {
    			$url .= '&';
    		}
    		$url .= "lang=".$lang;
    	}
    
    	$url = ltrim(str_replace('//', '/', $url),"/");
    
    	// & workaround
    	$complete = str_replace('&','&',$home."/".$url);
    	return $complete;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic