WordPress.org

Plugin Directory

Changeset 631999


Ignore:
Timestamp:
11/29/12 21:33:31 (17 months ago)
Author:
Chouby
Message:

redirect canonical again

Location:
polylang/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • polylang/trunk/include/base.php

    r627893 r631999  
    160160        elseif (is_string($value) && $taxonomy) 
    161161            $term_id = get_term_by('slug', $value , $taxonomy)->term_id; 
    162         return $term_id ? $this->get_language(get_metadata('term', $term_id, '_language', true)) : false; 
     162        return isset($term_id) && $term_id ? $this->get_language(get_metadata('term', $term_id, '_language', true)) : false; 
    163163    } 
    164164 
  • polylang/trunk/include/core.php

    r630317 r631999  
    560560    // prevents redirection of the homepage when using page on front 
    561561    function stop_redirect_canonical($redirect_url, $requested_url) { 
    562         $home_url = home_url('/'); 
    563         $page_link = $this->page_link('', get_option('page_on_front')); 
    564         return $requested_url == $home_url || ($page_link != $home_url && strpos($requested_url, $page_link ) !== false) ? false : $redirect_url; 
     562        if (($page_on_front = get_option('page_on_front')) && $page_on_front == get_query_var('page_id')) // default permalinks 
     563            return false; 
     564 
     565        $url = @parse_url($requested_url); 
     566        $url = trailingslashit($url['scheme'] . '://' .$url['host'] . (isset($url['path']) ? $url['path'] : '')); 
     567        $page_on_front = trailingslashit($this->page_link('', $page_on_front)); 
     568 
     569        return $url == home_url('/') || $url == $page_on_front ? false : $redirect_url; 
    565570    } 
    566571 
  • polylang/trunk/polylang.php

    r631451 r631999  
    33Plugin Name: Polylang 
    44Plugin URI: http://wordpress.org/extend/plugins/polylang/ 
    5 Version: 0.9.6.2 
     5Version: 0.9.6.3 
    66Author: F. Demarle 
    77Description: Adds multilingual capability to Wordpress 
     
    2727*/ 
    2828 
    29 define('POLYLANG_VERSION', '0.9.6.2'); 
     29define('POLYLANG_VERSION', '0.9.6.3'); 
    3030define('PLL_MIN_WP_VERSION', '3.1'); 
    3131 
  • polylang/trunk/readme.txt

    r630892 r631999  
    9494== Changelog == 
    9595 
    96 = 0.9.6.1 = 
     96= 0.9.7 = 
    9797 
    9898* Bug correction: the admin language filter does filter non translatable post types 
     99* Bug correction: again the canonical redirection 
    99100* Again test with WordPress 3.5 beta RC1 
    100101 
Note: See TracChangeset for help on using the changeset viewer.