Plugin Directory

Changeset 400175


Ignore:
Timestamp:
06/23/2011 02:05:35 AM (15 years ago)
Author:
dardna
Message:

fixed special characters on query using custom search base as 2.5.2 did not solve it.

Location:
wp-htaccess-control/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-htaccess-control/trunk/readme.txt

    r398682 r400175  
    77Requires at least: 2.7
    88Tested up to: 3.1.3
    9 Stable tag: 2.5.1
     9Stable tag: 2.5.3
    1010
    1111Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
     
    7373== Changelog ==
    7474
     75= 2.5.3 (23/06/2011) =
     76* *Fix:* fixed special characters on query using custom search base as 2.5.2 did not solve it.
     77
    7578= 2.5.2 (18/06/2011) =
    7679* *Fix:* fixed german umlauts and other special characters on query using custom search base (thank you for pointing it out Tatron);
  • wp-htaccess-control/trunk/wp-htaccess-control.php

    r398591 r400175  
    44Plugin URI: http://dardna.com/wp-htaccess-control
    55Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
    6 Version: 2.5.2
     6Version: 2.5.3
    77Author: António Andrade
    88Author URI: http://dardna.com
     
    4040            }
    4141        function wphtc_template_redirect(){
    42             # redirect "?s=*" to "/search-base/*"
    43             $WPhtc_data=get_option('WPhtc_data');
    44             if($_GET['s']&&$WPhtc_data['custom_search_permalink']!=''){
    45                 wp_redirect( home_url( $WPhtc_data['custom_search_permalink']. "/" .  urlencode(get_query_var( 's' )) ) );
     42            $WPhtc_data=get_option('WPhtc_data');
     43            if($WPhtc_data['custom_search_permalink']!=''){
     44                # redirect "?s=*" to "/search-base/*"
     45                if($_GET['s']){
     46                    wp_redirect( home_url( $WPhtc_data['custom_search_permalink']. "/" .  urlencode(get_query_var( 's' )) ) );
     47                    }
     48                # rewrite query
     49                if(strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){
     50                    global $wp_query;
     51                    $query=split($WPhtc_data['custom_search_permalink']."/",$_SERVER["REQUEST_URI"]);
     52                    $query=urldecode($query[1]);
     53                    $wp_query=new WP_Query('s='.$query );
     54                    }
    4655                }
    4756            }
     
    5261                $query=split($WPhtc_data['custom_search_permalink']."/",$_SERVER["REQUEST_URI"]);
    5362                $query=urldecode($query[1]);
     63                $query=$query;
    5464                }
    5565            return $query;
Note: See TracChangeset for help on using the changeset viewer.