From 2a11c994590c9a680c568377bb6f567cd7aec3de Mon Sep 17 00:00:00 2001 From: markjaquith Date: Fri, 9 Mar 2007 04:36:24 +0000 Subject: [PATCH] Sanitize browser-bound add_query_arg() outputs. fixes #3937 git-svn-id: http://svn.automattic.com/wordpress/trunk@5007 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 2 +- wp-admin/custom-header.php | 6 +++--- wp-admin/edit-comments.php | 12 ++++++------ wp-includes/script-loader.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 2fa0688e6e..336b702d3e 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1935,7 +1935,7 @@ function wp_import_upload_form( $action ) { if (strpos($size, 'g') !== false) $bytes = $size * 1024 * 1024 * 1024; ?> -
+

( ) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 1b913c28eb..5daad1e04e 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -174,7 +174,7 @@ Event.observe( window, 'load', hide_text );

%1$d x %2$d pixels will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?>

- +

@@ -188,7 +188,7 @@ Event.observe( window, 'load', hide_text );

- +
@@ -240,7 +240,7 @@ Event.observe( window, 'load', hide_text );
-
+

diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index e8fd200a06..4ba2479013 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -101,7 +101,7 @@ $total_pages = ceil( $total / 20 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : @@ -111,7 +111,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; - $r .= '' . ( $page_num ) . "\n"; + $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; @@ -122,7 +122,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { } if ( ( $page ) * 20 < $total || -1 == $total ) { $args['apage'] = $page + 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } echo ""; ?> @@ -248,7 +248,7 @@ $total_pages = ceil( $total / 20 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : @@ -258,7 +258,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; - $r .= '' . ( $page_num ) . "\n"; + $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; @@ -269,7 +269,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { } if ( ( $page ) * 20 < $total || -1 == $total ) { $args['apage'] = $page + 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } echo ""; ?> diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 31d7122512..a76331571f 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -150,7 +150,7 @@ class WP_Scripts { $ver .= '&' . $this->args[$handle]; $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; $src = add_query_arg('ver', $ver, $src); - $src = apply_filters( 'script_loader_src', $src ); + $src = attribute_escape(apply_filters( 'script_loader_src', $src )); echo "\n"; $this->print_scripts_l10n( $handle ); }