[wp-cvs] wordpress/wp-includes functions.php,1.110,1.111
Ryan Boren
rboren at users.sourceforge.net
Wed Jun 2 00:16:47 CDT 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7617/wp-includes
Modified Files:
functions.php
Log Message:
Rewrite rule fixes.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** functions.php 31 May 2004 23:35:32 -0000 1.110
--- functions.php 2 Jun 2004 05:16:44 -0000 1.111
***************
*** 1175,1179 ****
}
! function generate_rewrite_rules($permalink_structure = '') {
$rewritecode =
array(
--- 1175,1179 ----
}
! function generate_rewrite_rules($permalink_structure = '', $matches = '') {
$rewritecode =
array(
***************
*** 1200,1204 ****
'([_0-9a-z-]+)',
'([0-9]+)',
! '(.*)',
'([_0-9a-z-]+)'
);
--- 1200,1204 ----
'([_0-9a-z-]+)',
'([0-9]+)',
! '([/_0-9a-z-]+)',
'([_0-9a-z-]+)'
);
***************
*** 1268,1272 ****
$query = $index . '?' . $query . '&page=' . preg_index($num_toks + 1, $matches);
} else {
! $match .= '?';
$query = $index . '?' . $query;
}
--- 1268,1272 ----
$query = $index . '?' . $query . '&page=' . preg_index($num_toks + 1, $matches);
} else {
! $match .= '?$';
$query = $index . '?' . $query;
}
***************
*** 1299,1303 ****
}
! $post_rewrite = generate_rewrite_rules($permalink_structure);
// If the permalink does not have year, month, and day, we need to create a
--- 1299,1307 ----
}
! $post_rewrite = generate_rewrite_rules($permalink_structure, $matches);
!
! $feedregex = '(feed|rdf|rss|rss2|atom)/?$';
! $pageregex = 'page/?([0-9]{1,})/?$';
! $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
// If the permalink does not have year, month, and day, we need to create a
***************
*** 1307,1317 ****
$doarchive = true;
$archive_structure = $front . '%year%/%monthnum%/%day%/';
! $archive_rewrite = generate_rewrite_rules($archive_structure);
}
- $feedregex = '(feed|rdf|rss|rss2|atom)/?$';
- $pageregex = 'page/?([0-9]{1,})/?$';
- $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
-
// Site feed
$sitefeedmatch = 'feed/?([_0-9a-z-]+)?/?$';
--- 1311,1317 ----
$doarchive = true;
$archive_structure = $front . '%year%/%monthnum%/%day%/';
! $archive_rewrite = generate_rewrite_rules($archive_structure, $matches);
}
// Site feed
$sitefeedmatch = 'feed/?([_0-9a-z-]+)?/?$';
***************
*** 1339,1350 ****
$category_structure = $category_structure . '%category%';
! $category_rewrite = generate_rewrite_rules($category_structure);
// Authors
$author_structure = $front . 'author/%author%';
! $author_rewrite = generate_rewrite_rules($author_structure);
// Put them together.
! $rewrite = $site_rewrite + $category_rewrite + $author_rewrite + $post_rewrite;
// Add on archive rewrite rules if needed.
--- 1339,1350 ----
$category_structure = $category_structure . '%category%';
! $category_rewrite = generate_rewrite_rules($category_structure, $matches);
// Authors
$author_structure = $front . 'author/%author%';
! $author_rewrite = generate_rewrite_rules($author_structure, $matches);
// Put them together.
! $rewrite = $site_rewrite + $category_rewrite + $author_rewrite;
// Add on archive rewrite rules if needed.
***************
*** 1353,1356 ****
--- 1353,1358 ----
}
+ $rewrite = $rewrite + $post_rewrite;
+
return $rewrite;
}
More information about the cvs
mailing list