WP htaccess Control - Version 2.5.2

Version Description

(18/06/2011) = * Fix: fixed german umlauts and other special characters on query using custom search base (thank you for pointing it out Tatron); * Fix: get_search_query no longer empty when using custom search base.

Download this release

Release Info

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

Code changes from version 2.5.1 to 2.5.2

Files changed (2) hide show
  1. readme.txt +5 -1
  2. wp-htaccess-control.php +12 -2
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.1
10
 
11
  Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress.
12
 
@@ -72,6 +72,10 @@ Search redirection is based on Mark Jaquith's **Nice Search** but extended so th
72
 
73
  == Changelog ==
74
 
 
 
 
 
75
  = 2.5.1 (30/05/2011) =
76
  * *Fix:* fixed php short tag on wp-htaccess-control-ui.php (thank you caillou!).
77
  * Confirmed compatibility with WP 3.1.3.
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
 
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.
78
+
79
  = 2.5.1 (30/05/2011) =
80
  * *Fix:* fixed php short tag on wp-htaccess-control-ui.php (thank you caillou!).
81
  * Confirmed compatibility with WP 3.1.3.
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.1
7
  Author: António Andrade
8
  Author URI: http://dardna.com
9
  */
@@ -42,9 +42,18 @@ if (!class_exists("WPhtc")) {
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']. "/" . str_replace( array( ' ', '%20' ), array( '+', '+' ), get_query_var( 's' ) ) ) );
46
  }
47
  }
 
 
 
 
 
 
 
 
 
48
  function wphtc_check_first_run(){
49
  # flush rules to get some data filled
50
  $WPhtc_data=get_option('WPhtc_data');
@@ -544,6 +553,7 @@ if (isset($WPhtc)) {
544
  add_filter('author_link',array($WPhtc,'wphtc_filter_author_link'));
545
  add_filter('get_pagenum_link',array($WPhtc,'wphtc_filter_get_pagenum_link'));
546
  add_filter('redirect_canonical',array($WPhtc,'wphtc_filter_redirect_canonical'),10,10);
 
547
  add_action('admin_menu', array($WPhtc,'configure_menu'));
548
  add_action('sm_buildmap',array($WPhtc,'set_sm'));
549
  add_action('init', array($WPhtc,'wphtc_init'));
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
  */
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
49
+ function wphtc_get_search_query_filter($query){
50
+ $WPhtc_data=get_option('WPhtc_data');
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
+ }
57
  function wphtc_check_first_run(){
58
  # flush rules to get some data filled
59
  $WPhtc_data=get_option('WPhtc_data');
553
  add_filter('author_link',array($WPhtc,'wphtc_filter_author_link'));
554
  add_filter('get_pagenum_link',array($WPhtc,'wphtc_filter_get_pagenum_link'));
555
  add_filter('redirect_canonical',array($WPhtc,'wphtc_filter_redirect_canonical'),10,10);
556
+ add_filter('get_search_query',array($WPhtc,'wphtc_get_search_query_filter'),10,10);
557
  add_action('admin_menu', array($WPhtc,'configure_menu'));
558
  add_action('sm_buildmap',array($WPhtc,'set_sm'));
559
  add_action('init', array($WPhtc,'wphtc_init'));