Make WordPress Core

Changeset 1567


Ignore:
Timestamp:
08/27/2004 05:20:59 AM (20 years ago)
Author:
rboren
Message:

Eliminate use of DOCUMENT_ROOT. Look for .htaccess in 'home'.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r1535 r1567  
    1919        }
    2020    }
     21}
     22
     23$home = get_settings('home');
     24if ($home != '' && $home != get_settings('siteurl')) {
     25  $home_path = parse_url($home);
     26  $home_path = $home_root['path'];
     27  $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
     28  $home_path = $root . $home_path . "/";
     29} else {
     30  $home_path = ABSPATH;
    2131}
    2232
     
    4858<?php if(isset($_POST['rules'])) {
    4959        $rules = explode("\n", $_POST['rules']);
    50         if(insert_with_markers(ABSPATH.'.htaccess', 'WordPress', $rules)) {
     60        if(insert_with_markers($home_path.'.htaccess', 'WordPress', $rules)) {
    5161?>
    5262<div class="updated" id="htupdate"><p><?php _e('mod_rewrite rules written to .htaccess.'); ?></p></div>
     
    137147    </p>
    138148<?php
    139 if ((! file_exists(ABSPATH.'.htaccess') && is_writable(ABSPATH)) || is_writable(ABSPATH.'.htaccess')) {
     149
     150if ((! file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess')) {
    140151?>
    141152    <p class="submit">
  • trunk/wp-admin/templates.php

    r1503 r1567  
    9898
    9999    $home = get_settings('home');
    100     if ($home != '' && ('index.php' == $file || get_settings('blogfilename') == $file)) {
    101         $home_root = str_replace('http://', '', $home);
    102         $home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root);
    103         $real_file = $_SERVER['DOCUMENT_ROOT'] . $home_root . '/' . $file;
     100    if (($home != '' && $home != get_settings('siteurl')) &&
     101      ('index.php' == $file || get_settings('blogfilename') == $file ||
     102       '.htaccess' == $file)) {
     103        $home_root = parse_url($home);
     104    $home_root = $home_root['path'];
     105    $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
     106    $home_root = $root . $home_root;
     107        $real_file = $home_root . '/' . $file;
    104108    } else {
    105109        $file = validate_file($file);
Note: See TracChangeset for help on using the changeset viewer.