Changeset 1695
- Timestamp:
- 09/18/04 20:04:29 (4 years ago)
- Files:
-
- trunk/wp-includes/functions.php (modified) (5 diffs)
- trunk/wp-includes/template-functions-links.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/functions.php
r1682 r1695 1067 1067 } 1068 1068 1069 function using_ mod_rewrite($permalink_structure = '') {1069 function using_index_permalinks($permalink_structure = '') { 1070 1070 if (empty($permalink_structure)) { 1071 1071 $permalink_structure = get_settings('permalink_structure'); … … 1077 1077 1078 1078 // If the index is not in the permalink, we're using mod_rewrite. 1079 if ( ! preg_match('#^/*' . get_settings('blogfilename') . '#', $permalink_structure)) {1079 if (preg_match('#^/*index.php#', $permalink_structure)) { 1080 1080 return true; 1081 1081 } … … 1104 1104 } 1105 1105 1106 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 1107 $index = get_settings('blogfilename'); 1106 $index = 'index.php'; 1108 1107 $prefix = ''; 1109 if ( preg_match('#^/*' . $index . '#', $front)) {1108 if (using_index_permalinks()) { 1110 1109 $prefix = $index . '/'; 1111 1110 } … … 1172 1171 $num_tokens = count($tokens[0]); 1173 1172 1174 $index = get_settings('blogfilename');;1173 $index = 'index.php'; 1175 1174 $feedindex = $index; 1176 1175 $trackbackindex = $index; … … 1254 1253 $pageregex = 'page/?([0-9]{1,})/?$'; 1255 1254 $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 1256 $index = get_settings('blogfilename');1255 $index = 'index.php'; 1257 1256 $prefix = ''; 1258 if ( ! using_mod_rewrite($permalink_structure)) {1257 if (using_index_permalinks($permalink_structure)) { 1259 1258 $prefix = $index . '/'; 1260 1259 } trunk/wp-includes/template-functions-links.php
r1635 r1695 154 154 $do_perma = 1; 155 155 $feed_url = get_settings('home'); 156 $index = get_settings('blogfilename');156 $index = 'index.php'; 157 157 $prefix = ''; 158 if ( preg_match('#^/*' . $index . '#', $permalink)) {158 if (using_index_permalinks()) { 159 159 $feed_url .= '/' . $index; 160 160 } … … 419 419 $page_modregex = "page/?"; 420 420 $permalink = 0; 421 $index = 'index.php'; 421 422 422 423 $home_root = parse_url(get_settings('home')); … … 449 450 450 451 // If it's not a path info permalink structure, trim the index. 451 if ( using_mod_rewrite()) {452 $qstr = preg_replace("#/*" . get_settings('blogfilename'). "/*#", '/', $qstr);452 if (! using_index_permalinks()) { 453 $qstr = preg_replace("#/*" . $index . "/*#", '/', $qstr); 453 454 } else { 454 455 // If using path info style permalinks, make sure the index is in 455 456 // the URI. 456 if (strpos($qstr, get_settings('blogfilename')) === false) {457 $qstr = '/' . get_settings('blogfilename'). $qstr;457 if (strpos($qstr, $index) === false) { 458 $qstr = '/' . $index . $qstr; 458 459 } 459 460 } … … 461 462 $qstr = trailingslashit($qstr) . $page_modstring . $pagenum; 462 463 } else { 463 $qstr = get_settings('blogfilename'). $querystring_start.$page_querystring.$querystring_equal.$pagenum;464 $qstr = $index . $querystring_start.$page_querystring.$querystring_equal.$pagenum; 464 465 } 465 466 }
