Rename using_mod_rewrite() to using_index_permalinks(). Start removing blogfilename references.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-09-18 20:04:29 +00:00
parent a88c2a9db9
commit 76d4882921
2 changed files with 15 additions and 15 deletions

View File

@ -1066,7 +1066,7 @@ function remove_action($tag, $function_to_remove, $priority = 10) {
remove_filter($tag, $function_to_remove, $priority);
}
function using_mod_rewrite($permalink_structure = '') {
function using_index_permalinks($permalink_structure = '') {
if (empty($permalink_structure)) {
$permalink_structure = get_settings('permalink_structure');
@ -1076,7 +1076,7 @@ function using_mod_rewrite($permalink_structure = '') {
}
// If the index is not in the permalink, we're using mod_rewrite.
if (! preg_match('#^/*' . get_settings('blogfilename') . '#', $permalink_structure)) {
if (preg_match('#^/*index.php#', $permalink_structure)) {
return true;
}
@ -1103,10 +1103,9 @@ function page_permastruct() {
return '';
}
$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
$index = get_settings('blogfilename');
$index = 'index.php';
$prefix = '';
if (preg_match('#^/*' . $index . '#', $front)) {
if (using_index_permalinks()) {
$prefix = $index . '/';
}
@ -1171,7 +1170,7 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
$num_tokens = count($tokens[0]);
$index = get_settings('blogfilename');;
$index = 'index.php';
$feedindex = $index;
$trackbackindex = $index;
for ($i = 0; $i < $num_tokens; ++$i) {
@ -1253,9 +1252,9 @@ function rewrite_rules($matches = '', $permalink_structure = '') {
$feedregex = '(feed|rdf|rss|rss2|atom)/?$';
$pageregex = 'page/?([0-9]{1,})/?$';
$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
$index = get_settings('blogfilename');
$index = 'index.php';
$prefix = '';
if (! using_mod_rewrite($permalink_structure)) {
if (using_index_permalinks($permalink_structure)) {
$prefix = $index . '/';
}

View File

@ -153,9 +153,9 @@ function get_feed_link($feed='rss2') {
if ('' != $permalink) {
$do_perma = 1;
$feed_url = get_settings('home');
$index = get_settings('blogfilename');
$index = 'index.php';
$prefix = '';
if (preg_match('#^/*' . $index . '#', $permalink)) {
if (using_index_permalinks()) {
$feed_url .= '/' . $index;
}
@ -418,6 +418,7 @@ function get_pagenum_link($pagenum = 1){
$page_modstring = "page/";
$page_modregex = "page/?";
$permalink = 0;
$index = 'index.php';
$home_root = parse_url(get_settings('home'));
$home_root = $home_root['path'];
@ -448,19 +449,19 @@ function get_pagenum_link($pagenum = 1){
$permalink = 1;
// If it's not a path info permalink structure, trim the index.
if (using_mod_rewrite()) {
$qstr = preg_replace("#/*" . get_settings('blogfilename') . "/*#", '/', $qstr);
if (! using_index_permalinks()) {
$qstr = preg_replace("#/*" . $index . "/*#", '/', $qstr);
} else {
// If using path info style permalinks, make sure the index is in
// the URI.
if (strpos($qstr, get_settings('blogfilename')) === false) {
$qstr = '/' . get_settings('blogfilename') . $qstr;
if (strpos($qstr, $index) === false) {
$qstr = '/' . $index . $qstr;
}
}
$qstr = trailingslashit($qstr) . $page_modstring . $pagenum;
} else {
$qstr = get_settings('blogfilename') . $querystring_start.$page_querystring.$querystring_equal.$pagenum;
$qstr = $index . $querystring_start.$page_querystring.$querystring_equal.$pagenum;
}
}