WordPress.org

Make WordPress Core

Changeset 1392


Ignore:
Timestamp:
06/08/2004 03:40:17 AM (14 years ago)
Author:
rboren
Message:

Make the template editor use the home setting to find the index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/templates.php

    r1239 r1392  
    9797    }
    9898
    99     $file = validate_file($file);   
    100     $real_file = '../' . $file;
     99    $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;
     104    } else {
     105        $file = validate_file($file);
     106        $real_file = '../' . $file;
     107    }
    101108   
    102109    if (!is_file($real_file))
Note: See TracChangeset for help on using the changeset viewer.