WP htaccess Control - Version 2.5.3

Version Description

(23/06/2011) = * Fix: fixed special characters on query using custom search base as 2.5.2 did not solve it.

Download this release

Release Info

Developer dardna
Plugin Icon wp plugin WP htaccess Control
Version 2.5.3
Comparing to
See all releases

Code changes from version 2.5.2 to 2.5.3

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-htaccess-control.php +14 -4
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=s4man
6
  Tags: permalinks, permalink, author, htaccess, rewrite, redirect, admin, maintenance, pagination, category, category base, archive, archives
7
  Requires at least: 2.7
8
  Tested up to: 3.1.3
9
- Stable tag: 2.5.2
10
 
11
  Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
12
 
@@ -72,6 +72,9 @@ Search redirection is based on Mark Jaquith's **Nice Search** but extended so th
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 2.5.2 (18/06/2011) =
76
  * *Fix:* fixed german umlauts and other special characters on query using custom search base (thank you for pointing it out Tatron);
77
  * *Fix:* get_search_query no longer empty when using custom search base.
6
  Tags: permalinks, permalink, author, htaccess, rewrite, redirect, admin, maintenance, pagination, category, category base, archive, archives
7
  Requires at least: 2.7
8
  Tested up to: 3.1.3
9
+ Stable tag: 2.5.3
10
 
11
  Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
12
 
72
 
73
  == Changelog ==
74
 
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
+
78
  = 2.5.2 (18/06/2011) =
79
  * *Fix:* fixed german umlauts and other special characters on query using custom search base (thank you for pointing it out Tatron);
80
  * *Fix:* get_search_query no longer empty when using custom search base.
wp-htaccess-control.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP htaccess Control
4
  Plugin URI: http://dardna.com/wp-htaccess-control
5
  Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
6
- Version: 2.5.2
7
  Author: António Andrade
8
  Author URI: http://dardna.com
9
  */
@@ -39,10 +39,19 @@ if (!class_exists("WPhtc")) {
39
  }
40
  }
41
  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' )) ) );
 
 
 
 
 
 
 
 
 
 
46
  }
47
  }
48
  # return get_search_query on custom search base
@@ -51,6 +60,7 @@ if (!class_exists("WPhtc")) {
51
  if($WPhtc_data['custom_search_permalink']!=''&&strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){
52
  $query=split($WPhtc_data['custom_search_permalink']."/",$_SERVER["REQUEST_URI"]);
53
  $query=urldecode($query[1]);
 
54
  }
55
  return $query;
56
  }
3
  Plugin Name: WP htaccess Control
4
  Plugin URI: http://dardna.com/wp-htaccess-control
5
  Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
6
+ Version: 2.5.3
7
  Author: António Andrade
8
  Author URI: http://dardna.com
9
  */
39
  }
40
  }
41
  function wphtc_template_redirect(){
 
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
+ }
55
  }
56
  }
57
  # return get_search_query on custom search base
60
  if($WPhtc_data['custom_search_permalink']!=''&&strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){
61
  $query=split($WPhtc_data['custom_search_permalink']."/",$_SERVER["REQUEST_URI"]);
62
  $query=urldecode($query[1]);
63
+ $query=$query;
64
  }
65
  return $query;
66
  }