summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-30 11:17:02 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-30 11:17:02 +0000
commit541e47c09b503df8bd9b6d149c82cb8d98ac2710 (patch)
tree94c90cfd4eee2b1035f886877b77f53d1f1717c8 /wp-admin/includes
parent717b64911edf6baaa2aea29e13b8e808f088e660 (diff)
downloadwordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.tar.gz
wordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.tar.xz
wordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.zip
WP Merge to revision 8195
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1342 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes')
-rw-r--r--wp-admin/includes/file.php6
-rw-r--r--wp-admin/includes/media.php10
-rw-r--r--wp-admin/includes/schema.php3
-rw-r--r--wp-admin/includes/upgrade.php9
-rw-r--r--wp-admin/includes/user.php8
5 files changed, 20 insertions, 16 deletions
diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php
index 078cb9d..32f552c 100644
--- a/wp-admin/includes/file.php
+++ b/wp-admin/includes/file.php
@@ -287,7 +287,11 @@ function wp_handle_sideload( &$file, $overrides = false ) {
return $upload_error_handler( $file, $uploads['error'] );
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
-
+
+ // Strip the query strings.
+ $filename = str_replace('?','-', $filename);
+ $filename = str_replace('&','-', $filename);
+
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index d6fdec2..cf530d4 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -65,10 +65,10 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
function media_send_to_editor($html) {
?>
<script type="text/javascript">
-<!--
-top.send_to_editor('<?php echo addslashes($html); ?>');
-top.tb_remove();
--->
+/* <![CDATA[ */
+var win = window.dialogArguments || opener || parent || top;
+win.send_to_editor('<?php echo addslashes($html); ?>');
+/* ]]> */
</script>
<?php
exit;
@@ -850,7 +850,7 @@ jQuery(function($){
file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
post_params : {
"post_id" : "<?php echo $post_id; ?>",
- "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>",
+ "auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
"_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
"type" : "<?php echo $type; ?>",
"tab" : "<?php echo $tab; ?>",
diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index afaee6b..64b2eaf 100644
--- a/wp-admin/includes/schema.php
+++ b/wp-admin/includes/schema.php
@@ -229,8 +229,7 @@ CREATE TABLE IF NOT EXISTS $wpdb->signups (
function populate_options() {
global $wpdb, $wp_db_version, $current_site;
- $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
- $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ $guessurl = wp_guess_url();
do_action('populate_options');
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 07a4f9f..3d5ce74 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -21,12 +21,7 @@ function wp_install($blog_title, $user_name, $user_email, $public, $remote) {
update_option('enable_app',$remote);
update_option('enable_xmlrpc',$remote);
- $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
-
- if ( defined('WP_SITEURL') && '' != WP_SITEURL )
- $guessurl = WP_SITEURL;
- else
- $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ $guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
@@ -889,7 +884,7 @@ function deslash($content) {
function dbDelta($queries, $execute = true) {
global $wpdb;
- // Seperate individual queries into an array
+ // Separate individual queries into an array
if( !is_array($queries) ) {
$queries = explode( ';', $queries );
if('' == $queries[count($queries) - 1]) array_pop($queries);
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 4c02592..3bf4fd7 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -353,12 +353,18 @@ class WP_User_Search {
function do_paging() {
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
+ $args = array();
+ if( ! empty($this->search_term) )
+ $args['usersearch'] = urlencode($this->search_term);
+ if( ! empty($this->role) )
+ $args['role'] = urlencode($this->role);
+
$this->paging_text = paginate_links( array(
'total' => ceil($this->total_users_for_query / $this->users_per_page),
'current' => $this->page,
'base' => 'users.php?%_%',
'format' => 'userspage=%#%',
- 'add_args' => array( 'usersearch' => urlencode($this->search_term) )
+ 'add_args' => $args
) );
}
}