[wp-cvs] wordpress/wp-includes functions.php, 1.143, 1.144 template-functions-links.php, 1.29, 1.30

Ryan Boren rboren at users.sourceforge.net
Mon Aug 23 23:28:17 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21705/wp-includes

Modified Files:
	functions.php template-functions-links.php 
Log Message:
 Fix a path info paging bug.  Add using_mod_rewrite().

Index: template-functions-links.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-links.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** template-functions-links.php	17 Aug 2004 02:29:37 -0000	1.29
--- template-functions-links.php	23 Aug 2004 23:28:14 -0000	1.30
***************
*** 350,355 ****
  
  	 // If it's not a path info permalink structure, trim the index.
! 	 if ( ! preg_match('#^/*' . get_settings('blogfilename') . '#', get_settings('permalink_structure'))) {
  	   $qstr = preg_replace("#/*" . get_settings('blogfilename') . "/*#", '/', $qstr);
  	 }
  
--- 350,361 ----
  
  	 // If it's not a path info permalink structure, trim the index.
! 	 if (using_mod_rewrite()) {
  	   $qstr = preg_replace("#/*" . get_settings('blogfilename') . "/*#", '/', $qstr);
+ 	 } else {
+ 	   // If using path info style permalinks, make sure the index is in
+ 	   // the URI.
+ 	   if (! strstr($qstr, get_settings('blogfilename'))) {
+ 	     $qstr = '/' . get_settings('blogfilename') . $qstr;
+ 	   }
  	 }
  

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** functions.php	18 Aug 2004 21:05:34 -0000	1.143
--- functions.php	23 Aug 2004 23:28:14 -0000	1.144
***************
*** 1164,1167 ****
--- 1164,1184 ----
  }
  
+ function using_mod_rewrite($permalink_structure = '') {
+     if (empty($permalink_structure)) {
+         $permalink_structure = get_settings('permalink_structure');
+ 	
+         if (empty($permalink_structure)) {
+             return false;
+         }
+     }
+ 
+     // If the index is not in the permalink, we're using mod_rewrite.
+     if (! preg_match('#^/*' . get_settings('blogfilename') . '#', $permalink_structure)) {
+       return true;
+     }
+     
+     return false;
+ }
+ 
  function preg_index($number, $matches = '') {
      $match_prefix = '$';
***************
*** 1252,1258 ****
      $num_tokens = count($tokens[0]);
  
!     $index = 'index.php';
!     $feedindex = 'index.php';
!     $trackbackindex = 'index.php';
      for ($i = 0; $i < $num_tokens; ++$i) {
               if (0 < $i) {
--- 1269,1275 ----
      $num_tokens = count($tokens[0]);
  
!     $index = get_settings('blogfilename');;
!     $feedindex = $index;
!     $trackbackindex = $index;
      for ($i = 0; $i < $num_tokens; ++$i) {
               if (0 < $i) {
***************
*** 1335,1339 ****
      $index = get_settings('blogfilename');
      $prefix = '';
!     if (preg_match('#^/*' . $index . '#', $front)) {
          $prefix = $index . '/';
      }
--- 1352,1356 ----
      $index = get_settings('blogfilename');
      $prefix = '';
!     if (! using_mod_rewrite($permalink_structure)) {
          $prefix = $index . '/';
      }




More information about the cvs mailing list