[wp-trac] Re: [WordPress Trac] #3514: IIS fix for get_pagenum_link

WordPress Trac wp-trac at lists.automattic.com
Sat May 26 08:15:08 GMT 2007


#3514: IIS fix for get_pagenum_link
---------------------------------------------------+------------------------
 Reporter:  snakefoot                              |        Owner:  markjaquith
     Type:  defect                                 |       Status:  assigned   
 Priority:  high                                   |    Milestone:  2.3        
Component:  General                                |      Version:  2.0        
 Severity:  major                                  |   Resolution:             
 Keywords:  get_pagenum_link, iis, posts_nav_link  |  
---------------------------------------------------+------------------------
Comment (by snakefoot):

 Just made a plugin with the following code and now no modification is
 needed in the get_pagenum_link() (Still need the modification in
 wp_settings.php to make WP-Cache work)
 {{{
 function fix_request_uri()
 {
         global $wp_rewrite;

         if ($wp_rewrite->using_index_permalinks())
         {
                 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] .
 $_SERVER['PATH_INFO'];
         }
         else
         {
                 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
         }

         // Append the query string if it exists and isn't null
         if (isset($_SERVER['QUERY_STRING']) &&
 !empty($_SERVER['QUERY_STRING']))
         {
                 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
         }
 }

 add_action('init', 'fix_request_uri');
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3514#comment:10>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list