Plugin Directory

Changeset 1014363


Ignore:
Timestamp:
10/26/2014 09:58:42 PM (11 years ago)
Author:
chsxf
Message:

Merge pull request #10 from no1lives4ever/patch-1

Fixed redirection problem with HTTPS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mqtranslate/trunk/mqtranslate_core.php

    r989107 r1014363  
    120120                if(qtrans_isEnabled($language)) {
    121121                    if($q_config['hide_default_language'] && $language == $q_config['default_language']) break;
    122                     $target = qtrans_convertURL(get_option('home'),$language);
     122                    $target = qtrans_convertURL(qtrans_getHome(),$language);
    123123                    break;
    124124                }
     
    160160}
    161161
     162// returns the home in HTTP or HTTPS depending on the request
     163function qtrans_getHome() {
     164       $home = get_option('home');
     165       if(is_ssl()) {
     166               $home = str_replace('http://', 'https://', $home);
     167       } else {
     168               $home = str_replace('https://', 'http://', $home);
     169       }
     170       return $home;
     171}
     172
    162173function qtrans_postInit() {
    163174    // init Javascript functions
     
    171182function qtrans_extractURL($url, $host = '', $referer = '') {
    172183    global $q_config;
    173     $home = qtrans_parseURL(get_option('home'));
     184    $home = qtrans_parseURL(qtrans_getHome());
    174185    $home['path'] = trailingslashit($home['path']);
    175186    $referer = qtrans_parseURL($referer);
     
    635646    // check if it's an external link
    636647    $urlinfo = qtrans_parseURL($url);
    637     $home = rtrim(get_option('home'),"/");
     648    $home = rtrim(qtrans_getHome(),"/");
    638649    if($urlinfo['host']!='') {
    639650        // check for already existing pre-domain language information
Note: See TracChangeset for help on using the changeset viewer.