[wp-cvs] wordpress/wp-admin admin-functions.php, 1.69, 1.70 options-permalink.php, 1.51, 1.52

Ryan Boren rboren at users.sourceforge.net
Thu Dec 23 00:53:59 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32217/wp-admin

Modified Files:
	admin-functions.php options-permalink.php 
Log Message:
Use SCRIPT_FILENAME instead of PATH_TRANSLATED since PATH_TRANSLATED is not always set.  Consolidate home path logic into get_home_path().

Index: options-permalink.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-permalink.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** options-permalink.php	12 Dec 2004 06:31:00 -0000	1.51
--- options-permalink.php	23 Dec 2004 00:53:56 -0000	1.52
***************
*** 7,19 ****
  include('admin-header.php');
  
! $home = get_settings('home');
! if ( $home != '' && $home != get_settings('siteurl') ) {
! 	$home_path = parse_url($home);
! 	$home_path = $home_root['path'];
! 	$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
! 	$home_path = $root . $home_path . "/";
! } else {
! 	$home_path = ABSPATH;
! }
  
  if ( isset($_POST) ) {
--- 7,11 ----
  include('admin-header.php');
  
! $home_path = get_home_path();
  
  if ( isset($_POST) ) {

Index: admin-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** admin-functions.php	14 Dec 2004 09:24:39 -0000	1.69
--- admin-functions.php	23 Dec 2004 00:53:56 -0000	1.70
***************
*** 496,508 ****
  function save_mod_rewrite_rules() {
  	global $is_apache, $wp_rewrite;
! 	$home = get_settings('home');
! 	if ( $home != '' && $home != get_settings('siteurl') ) {
! 		$home_path = parse_url($home);
! 		$home_path = $home_root['path'];
! 		$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
! 		$home_path = $root . $home_path . "/";
! 	} else {
! 		$home_path = ABSPATH;
! 	}
  
  	if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
--- 496,500 ----
  function save_mod_rewrite_rules() {
  	global $is_apache, $wp_rewrite;
! 	$home_path = get_home_path();
  
  	if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
***************
*** 788,802 ****
  }
  
! function get_real_file_to_edit($file) {
  	$home = get_settings('home');
! 	if (($home != '')
! 			&& ($home != get_settings('siteurl')) &&
! 			('index.php' == $file || get_settings('blogfilename') == $file ||
! 			 '.htaccess' == $file)) {
! 		$home_root = parse_url($home);
! 		$home_root = $home_root['path'];
! 		$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
! 		$home_root = $root . $home_root;
! 		$real_file = $home_root . '/' . $file;
  	} else {
  		$real_file = ABSPATH . $file;
--- 780,801 ----
  }
  
! function get_home_path() {
  	$home = get_settings('home');
! 	if ( $home != '' && $home != get_settings('siteurl') ) {
! 		$home_path = parse_url($home);
! 		$home_path = $home_root['path'];
! 		$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"]);
! 		$home_path = $root . $home_path . "/";
! 	} else {
! 		$home_path = ABSPATH;
! 	}
! 
! 	return $home_path;
! }
! 
! function get_real_file_to_edit($file) {
! 	if ('index.php' == $file || get_settings('blogfilename') == $file ||
! 			 '.htaccess' == $file) {
! 		$real_file = get_home_path() . $file;
  	} else {
  		$real_file = ABSPATH . $file;




More information about the cvs mailing list