Changeset 1555
- Timestamp:
- 08/23/2004 11:28:14 PM (21 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
-
functions.php (modified) (3 diffs)
-
template-functions-links.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1540 r1555 1164 1164 } 1165 1165 1166 function using_mod_rewrite($permalink_structure = '') { 1167 if (empty($permalink_structure)) { 1168 $permalink_structure = get_settings('permalink_structure'); 1169 1170 if (empty($permalink_structure)) { 1171 return false; 1172 } 1173 } 1174 1175 // If the index is not in the permalink, we're using mod_rewrite. 1176 if (! preg_match('#^/*' . get_settings('blogfilename') . '#', $permalink_structure)) { 1177 return true; 1178 } 1179 1180 return false; 1181 } 1182 1166 1183 function preg_index($number, $matches = '') { 1167 1184 $match_prefix = '$'; … … 1252 1269 $num_tokens = count($tokens[0]); 1253 1270 1254 $index = 'index.php';1255 $feedindex = 'index.php';1256 $trackbackindex = 'index.php';1271 $index = get_settings('blogfilename');; 1272 $feedindex = $index; 1273 $trackbackindex = $index; 1257 1274 for ($i = 0; $i < $num_tokens; ++$i) { 1258 1275 if (0 < $i) { … … 1335 1352 $index = get_settings('blogfilename'); 1336 1353 $prefix = ''; 1337 if ( preg_match('#^/*' . $index . '#', $front)) {1354 if (! using_mod_rewrite($permalink_structure)) { 1338 1355 $prefix = $index . '/'; 1339 1356 } -
trunk/wp-includes/template-functions-links.php
r1537 r1555 350 350 351 351 // If it's not a path info permalink structure, trim the index. 352 if ( ! preg_match('#^/*' . get_settings('blogfilename') . '#', get_settings('permalink_structure'))) {352 if (using_mod_rewrite()) { 353 353 $qstr = preg_replace("#/*" . get_settings('blogfilename') . "/*#", '/', $qstr); 354 } else { 355 // If using path info style permalinks, make sure the index is in 356 // the URI. 357 if (! strstr($qstr, get_settings('blogfilename'))) { 358 $qstr = '/' . get_settings('blogfilename') . $qstr; 359 } 354 360 } 355 361
Note: See TracChangeset
for help on using the changeset viewer.