Ticket #1372: wp-secure-schema.patch
| File wp-secure-schema.patch, 4.1 KB (added by , 21 years ago) |
|---|
-
wp-includes/functions.php
679 679 $link_url = $matches[2][$i]; 680 680 $link_text = $matches[4][$i]; 681 681 $content = str_replace($link_match, $link_text.' '.$link_number, $content); 682 $link_url = ( strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('home') . $link_url : $link_url;682 $link_url = ((strtolower(substr($link_url,0,7)) != 'http://')||(strtolower(substr($link_url,0,7)) != 'https://')) ? get_settings('home') . $link_url : $link_url; 683 683 $links_summary .= "\n".$link_number.' '.$link_url; 684 684 } 685 685 $content = strip_tags($content); … … 1843 1843 } 1844 1844 } 1845 1845 1846 ?> 1847 No newline at end of file 1846 ?> -
xmlrpc.php
283 283 284 284 /* warning: here we make the assumption that the weblog's URI is on the same server */ 285 285 $filename = get_settings('home') . '/'; 286 $filename = preg_replace('#http ://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);286 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 287 287 288 288 $f = fopen($filename, 'r'); 289 289 $content = fread($f, filesize($filename)); … … 317 317 318 318 /* warning: here we make the assumption that the weblog's URI is on the same server */ 319 319 $filename = get_settings('home') . '/'; 320 $filename = preg_replace('#http ://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);320 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 321 321 322 322 if ($f = fopen($filename, 'w+')) { 323 323 fwrite($f, $content); … … 1090 1090 $error_code = -1; 1091 1091 1092 1092 // Check if the page linked to is in our site 1093 $pos1 = strpos($pagelinkedto, str_replace( 'http://', '', str_replace('www.', '', get_settings('home'))));1093 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_settings('home'))); 1094 1094 if(!$pos1) { 1095 1095 return new IXR_Error(0, ''); 1096 1096 } … … 1176 1176 preg_match('|<title>([^<]*?)</title>|is', $linea, $matchtitle); 1177 1177 } 1178 1178 $pos2 = strpos($linea, $pagelinkedto); 1179 $pos3 = strpos($linea, str_replace( 'http://www.', 'http://', $pagelinkedto));1179 $pos3 = strpos($linea, str_replace(array('http://www.','https://www.'), array('http://','https://'), $pagelinkedto)); 1180 1180 if (is_integer($pos2) || is_integer($pos3)) { 1181 1181 // The page really links to us :) 1182 1182 $pos4 = (is_integer($pos2)) ? $pos2 : $pos3; … … 1270 1270 1271 1271 $wp_xmlrpc_server = new wp_xmlrpc_server(); 1272 1272 1273 ?> 1274 No newline at end of file 1273 ?> -
wp-admin/install.php
6 6 require_once('../wp-config.php'); 7 7 require_once('./upgrade-functions.php'); 8 8 9 $guessurl = str_replace('/wp-admin/install.php?step=2', '', 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ); 9 $schema = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?'https://':'http://'; 10 $guessurl = str_replace('/wp-admin/install.php?step=2', '', $schema . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ); 10 11 11 12 if (isset($_GET['step'])) 12 13 $step = $_GET['step']; -
wp-admin/upgrade-schema.php
151 151 function populate_options() { 152 152 global $wpdb; 153 153 154 $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 154 $schema = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?'https://':'http://'; 155 $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 155 156 add_option('siteurl', $guessurl, __('WordPress web address')); 156 157 add_option('blogname', __('My Weblog'), __('Blog title')); 157 158 add_option('blogdescription', __('Just another WordPress weblog'), __('Short tagline'));