Changeset 400579
- Timestamp:
- 06/23/2011 09:17:58 PM (15 years ago)
- Location:
- wp-htaccess-control/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wp-htaccess-control.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-htaccess-control/trunk/readme.txt
r400175 r400579 73 73 == Changelog == 74 74 75 = 2.5.4 (23/06/2011) = 76 * *Fix:* fixed search feed using custom search base. 77 75 78 = 2.5.3 (23/06/2011) = 76 79 * *Fix:* fixed special characters on query using custom search base as 2.5.2 did not solve it. -
wp-htaccess-control/trunk/wp-htaccess-control.php
r400175 r400579 4 4 Plugin URI: http://dardna.com/wp-htaccess-control 5 5 Description: Interface to customize the permalinks (author, category, archives and pagination) and htaccess file generated by Wordpress. 6 Version: 2.5. 36 Version: 2.5.4 7 7 Author: António Andrade 8 8 Author URI: http://dardna.com … … 49 49 if(strpos($_SERVER["REQUEST_URI"], $WPhtc_data['custom_search_permalink'])){ 50 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 ); 51 if(strpos($_SERVER["REQUEST_URI"], '/feed')){ 52 preg_match("/feed\/(feed|rdf|rss|rss2|atom)?/",$_SERVER["REQUEST_URI"], $feed); 53 if($feed[1]){ 54 $format="&feed=".$feed[1]; 55 } 56 else{ 57 $format="&feed=feed"; 58 } 59 } 60 $page_base=($WPhtc_data['cpp']!='')?$WPhtc_data['cpp']:'page'; 61 # in need of better regex 62 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"],$page_base)){ 63 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 64 } 65 else{ 66 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)\/feed|".$page_base."?/"; 67 } 68 preg_match($pattern,$_SERVER["REQUEST_URI"], $matches); 69 $wp_query=new WP_Query('s='.$matches[1].$format ); 54 70 } 55 71 } … … 59 75 $WPhtc_data=get_option('WPhtc_data'); 60 76 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; 77 # in need of better regex 78 if(!strpos($_SERVER["REQUEST_URI"], '/feed')&&!strpos($_SERVER["REQUEST_URI"],$page_base)){ 79 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)/"; 80 } 81 else{ 82 $pattern="/\/".$WPhtc_data['custom_search_permalink']."\/(.+)\/feed|".$page_base."?/"; 83 } 84 preg_match($pattern,$_SERVER["REQUEST_URI"], $matches); 85 return urldecode($matches[1]); 64 86 } 65 87 return $query; 88 } 89 function wphtc_search_feed_link($link){ 90 $WPhtc_data=get_option('WPhtc_data'); 91 if($WPhtc_data['custom_search_permalink']!=''){ 92 $link=str_replace("search",$WPhtc_data['custom_search_permalink'],$link); 93 } 94 return $link; 66 95 } 67 96 function wphtc_check_first_run(){ … … 565 594 add_filter('redirect_canonical',array($WPhtc,'wphtc_filter_redirect_canonical'),10,10); 566 595 add_filter('get_search_query',array($WPhtc,'wphtc_get_search_query_filter'),10,10); 596 add_filter('search_feed_link',array($WPhtc,'wphtc_search_feed_link'),10,10); 567 597 add_action('admin_menu', array($WPhtc,'configure_menu')); 568 598 add_action('sm_buildmap',array($WPhtc,'set_sm'));
Note: See TracChangeset
for help on using the changeset viewer.