Ticket #18952: 18952.5.patch
File 18952.5.patch, 11.0 KB (added by , 13 years ago) |
---|
-
wp-admin/admin-header.php
55 55 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 56 56 'time':'<?php echo time() ?>' 57 57 }, 58 ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>',58 ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', 59 59 pagenow = '<?php echo $current_screen->id; ?>', 60 60 typenow = '<?php echo $current_screen->post_type; ?>', 61 61 adminpage = '<?php echo $admin_body_class; ?>', -
wp-admin/includes/image-edit.php
67 67 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" /> 68 68 69 69 <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 70 <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php'); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" />70 <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" /> 71 71 </div> 72 72 73 73 <div class="imgedit-submit"> -
wp-admin/includes/media.php
334 334 //<![CDATA[ 335 335 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 336 336 var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'}; 337 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',337 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 338 338 isRtl = <?php echo (int) is_rtl(); ?>; 339 339 //]]> 340 340 </script> -
wp-admin/includes/template.php
1394 1394 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 1395 1395 'time':'<?php echo time() ?>' 1396 1396 }, 1397 ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>',1397 ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', 1398 1398 pagenow = '<?php echo $current_screen->id; ?>', 1399 1399 typenow = '<?php echo $current_screen->post_type; ?>', 1400 1400 adminpage = '<?php echo $admin_body_class; ?>', -
wp-admin/press-this.php
304 304 //<![CDATA[ 305 305 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 306 306 var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'}; 307 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;307 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 308 308 var photostorage = false; 309 309 //]]> 310 310 </script> -
wp-includes/class-wp-editor.php
584 584 } 585 585 586 586 if ( !is_admin() ) 587 echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php') . '";';587 echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";'; 588 588 ?> 589 589 </script> 590 590 <?php -
wp-includes/link-template.php
1834 1834 * @uses get_home_url() 1835 1835 * 1836 1836 * @param string $path (optional) Path relative to the home url. 1837 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https' .1837 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https', or 'relative'. 1838 1838 * @return string Home url link with optional path appended. 1839 1839 */ 1840 1840 function home_url( $path = '', $scheme = null ) { … … 1853 1853 * 1854 1854 * @param int $blog_id (optional) Blog ID. Defaults to current blog. 1855 1855 * @param string $path (optional) Path relative to the home url. 1856 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https' .1856 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https', or 'relative'. 1857 1857 * @return string Home url link with optional path appended. 1858 1858 */ 1859 1859 function get_home_url( $blog_id = null, $path = '', $scheme = null ) { 1860 1860 $orig_scheme = $scheme; 1861 1861 1862 if ( !in_array( $scheme, array( 'http', 'https' ) ) )1862 if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) 1863 1863 $scheme = is_ssl() && !is_admin() ? 'https' : 'http'; 1864 1864 1865 1865 if ( empty( $blog_id ) || !is_multisite() ) … … 1867 1867 else 1868 1868 $url = get_blog_option( $blog_id, 'home' ); 1869 1869 1870 if ( 'http' != $scheme ) 1870 if ( 'relative' == $scheme ) 1871 $url = preg_replace( '#^.+://[^/]*#', '', $url ); 1872 elseif ( 'http' != $scheme ) 1871 1873 $url = str_replace( 'http://', "$scheme://", $url ); 1872 1874 1873 1875 if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) … … 1889 1891 * @uses get_site_url() 1890 1892 * 1891 1893 * @param string $path Optional. Path relative to the site url. 1892 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', or 'admin'.1894 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'. 1893 1895 * @return string Site url link with optional path appended. 1894 1896 */ 1895 1897 function site_url( $path = '', $scheme = null ) { … … 1908 1910 * 1909 1911 * @param int $blog_id (optional) Blog ID. Defaults to current blog. 1910 1912 * @param string $path Optional. Path relative to the site url. 1911 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', or 'admin'.1913 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'. 1912 1914 * @return string Site url link with optional path appended. 1913 1915 */ 1914 1916 function get_site_url( $blog_id = null, $path = '', $scheme = null ) { 1915 1917 // should the list of allowed schemes be maintained elsewhere? 1916 1918 $orig_scheme = $scheme; 1917 if ( !in_array( $scheme, array( 'http', 'https' ) ) ) {1919 if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) { 1918 1920 if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) ) 1919 1921 $scheme = 'https'; 1920 1922 elseif ( ( 'login' == $scheme ) && force_ssl_admin() ) … … 1930 1932 else 1931 1933 $url = get_blog_option( $blog_id, 'siteurl' ); 1932 1934 1933 if ( 'http' != $scheme ) 1935 if ( 'relative' == $scheme ) 1936 $url = preg_replace( '#^.+://[^/]*#', '', $url ); 1937 elseif ( 'http' != $scheme ) 1934 1938 $url = str_replace( 'http://', "{$scheme}://", $url ); 1935 1939 1936 1940 if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) … … 2061 2065 * @since 3.0.0 2062 2066 * 2063 2067 * @param string $path Optional. Path relative to the site url. 2064 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', or 'admin'.2068 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'. 2065 2069 * @return string Site url link with optional path appended. 2066 2070 */ 2067 2071 function network_site_url( $path = '', $scheme = null ) { … … 2071 2075 return site_url($path, $scheme); 2072 2076 2073 2077 $orig_scheme = $scheme; 2074 if ( !in_array( $scheme, array('http', 'https')) ) {2078 if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) { 2075 2079 if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) ) 2076 2080 $scheme = 'https'; 2077 2081 elseif ( ('login' == $scheme) && ( force_ssl_admin() ) ) … … 2082 2086 $scheme = ( is_ssl() ? 'https' : 'http' ); 2083 2087 } 2084 2088 2085 $url = $scheme . '://' . $current_site->domain . $current_site->path; 2089 if ( 'relative' == $scheme ) 2090 $url = $current_site->path; 2091 else 2092 $url = $scheme . '://' . $current_site->domain . $current_site->path; 2086 2093 2087 2094 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 2088 2095 $url .= ltrim($path, '/'); … … 2101 2108 * @since 3.0.0 2102 2109 * 2103 2110 * @param string $path (optional) Path relative to the home url. 2104 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https' .2111 * @param string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https', or 'relative'. 2105 2112 * @return string Home url link with optional path appended. 2106 2113 */ 2107 2114 function network_home_url( $path = '', $scheme = null ) { … … 2112 2119 2113 2120 $orig_scheme = $scheme; 2114 2121 2115 if ( !in_array( $scheme, array('http', 'https')) )2122 if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) 2116 2123 $scheme = is_ssl() && !is_admin() ? 'https' : 'http'; 2117 2124 2118 $url = $scheme . '://' . $current_site->domain . $current_site->path; 2125 if ( 'relative' == $scheme ) 2126 $url = $current_site->path; 2127 else 2128 $url = $scheme . '://' . $current_site->domain . $current_site->path; 2119 2129 2120 2130 if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) 2121 2131 $url .= ltrim( $path, '/' ); -
wp-includes/media.php
1096 1096 <script type="text/javascript"> 1097 1097 /* <![CDATA[ */ 1098 1098 jQuery(document).ready(function($){ 1099 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>");1099 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID, 'relative' ); ?>"); 1100 1100 }); 1101 1101 /* ]]> */ 1102 1102 </script>