From 76d4882921930addfcd1ec132c8a40c2776a9e78 Mon Sep 17 00:00:00 2001 From: rboren Date: Sat, 18 Sep 2004 20:04:29 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 15 +++++++-------- wp-includes/template-functions-links.php | 15 ++++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 422d265837..a31f15b77d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 . '/'; } diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index 4efe8b9282..144ce3c492 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -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; } }