Skip to content

Commit d43ba91

Browse files
committed
Don't use deprecated functions. see WordPress#11388
git-svn-id: https://develop.svn.wordpress.org/trunk@13106 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 013ab6d commit d43ba91

13 files changed

Lines changed: 29 additions & 29 deletions

File tree

wp-admin/includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
246246
function wp_update_link( $linkdata ) {
247247
$link_id = (int) $linkdata['link_id'];
248248

249-
$link = get_link( $link_id, ARRAY_A );
249+
$link = get_bookmark( $link_id, ARRAY_A );
250250

251251
// Escape data pulled from DB.
252252
$link = add_magic_quotes( $link );

wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ function get_media_items( $post_id, $errors ) {
11461146
function get_media_item( $attachment_id, $args = null ) {
11471147
global $redir_tab;
11481148

1149-
if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
1149+
if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id ) )
11501150
$thumb_url = $thumb_url[0];
11511151
else
11521152
return false;

wp-admin/includes/ms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
212212

213213
if ( is_array( $blog_allowed_themes ) ) {
214214
foreach( (array) $themes as $key => $theme ) {
215-
$theme_key = wp_specialchars( $theme[ 'Stylesheet' ] );
215+
$theme_key = esc_html( $theme[ 'Stylesheet' ] );
216216
if ( isset( $blog_allowed_themes[ $key ] ) == true ) {
217217
$blog_allowedthemes[ $theme_key ] = 1;
218218
}
@@ -335,7 +335,7 @@ function get_site_allowed_themes() {
335335
$allowed_themes = array();
336336
} else {
337337
foreach( (array) $themes as $key => $theme ) {
338-
$theme_key = wp_specialchars( $theme[ 'Stylesheet' ] );
338+
$theme_key = esc_html( $theme[ 'Stylesheet' ] );
339339
if ( isset( $allowed_themes[ $key ] ) == true ) {
340340
$allowedthemes[ $theme_key ] = 1;
341341
}

wp-admin/includes/theme.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ function get_allowed_themes() {
142142
if ( is_array( $blog_allowed_themes ) )
143143
$allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );
144144

145-
if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )
146-
$allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true;
145+
if ( isset( $allowed_themes[ esc_html( $ct->stylesheet ) ] ) == false )
146+
$allowed_themes[ esc_html( $ct->stylesheet ) ] = true;
147147

148148
reset( $themes );
149149
foreach ( $themes as $key => $theme ) {
150-
if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false )
150+
if ( isset( $allowed_themes[ esc_html( $theme[ 'Stylesheet' ] ) ] ) == false )
151151
unset( $themes[ $key ] );
152152
}
153153
reset( $themes );

wp-admin/includes/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function edit_user( $user_id = 0 ) {
9292
if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
9393
$user->user_url = '';
9494
} else {
95-
$user->user_url = sanitize_url( $_POST['url'] );
95+
$user->user_url = esc_url_raw( $_POST['url'] );
9696
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
9797
}
9898
}

wp-admin/ms-edit.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@
385385
$themes = get_themes();
386386
reset( $themes );
387387
foreach ( (array) $themes as $key => $theme ) {
388-
if ( $_POST['theme'][ wp_specialchars( $theme['Stylesheet'] ) ] == 'enabled' )
389-
$allowed_themes[ wp_specialchars( $theme['Stylesheet'] ) ] = true;
388+
if ( $_POST['theme'][ esc_html( $theme['Stylesheet'] ) ] == 'enabled' )
389+
$allowed_themes[ esc_html( $theme['Stylesheet'] ) ] = true;
390390
}
391391
update_site_option( 'allowedthemes', $allowed_themes );
392392
}
@@ -413,12 +413,12 @@
413413
</head>
414414
<body id="error-page">
415415
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
416-
<form action='ms-edit.php?action=<?php echo wp_specialchars( $_GET[ 'action2' ] ) ?>' method='post'>
417-
<input type='hidden' name='action' value='<?php echo wp_specialchars( $_GET['action2'] ) ?>' />
418-
<input type='hidden' name='id' value='<?php echo wp_specialchars( $id ); ?>' />
416+
<form action='ms-edit.php?action=<?php echo esc_attr( $_GET[ 'action2' ] ) ?>' method='post'>
417+
<input type='hidden' name='action' value='<?php echo esc_attr( $_GET['action2'] ) ?>' />
418+
<input type='hidden' name='id' value='<?php echo esc_attr( $id ); ?>' />
419419
<input type='hidden' name='ref' value='<?php echo $referrer; ?>' />
420420
<?php wp_nonce_field( $_GET['action2'] ) ?>
421-
<p><?php echo wp_specialchars( stripslashes($_GET['msg']) ); ?></p>
421+
<p><?php echo esc_html( stripslashes($_GET['msg']) ); ?></p>
422422
<p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p>
423423
</form>
424424
</body>
@@ -499,7 +499,7 @@
499499
wp_die( __('Missing email.') );
500500

501501
$password = wp_generate_password();
502-
$user_id = wpmu_create_user(wp_specialchars( strtolower( $user['username'] ) ), $password, wp_specialchars( $user['email'] ) );
502+
$user_id = wpmu_create_user(wp_specialchars( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
503503

504504
if ( false == $user_id )
505505
wp_die( __('Duplicated username or email address.') );

wp-admin/ms-options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
$menu_perms = get_site_option( 'menu_items' );
281281
$menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );
282282
foreach ( (array) $menu_items as $key => $val ) {
283-
echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . checked($menu_perms[$key], '1', false) . " /></td></tr>";
283+
echo "<tr><th scope='row'>" . esc_html($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . checked($menu_perms[$key], '1', false) . " /></td></tr>";
284284
}
285285
?>
286286
</table>

wp-admin/ms-sites.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
$disabled = '';
169169
if ( is_serialized($option->option_value) ) {
170170
if ( is_serialized_string($option->option_value) ) {
171-
$option->option_value = wp_specialchars(maybe_unserialize($option->option_value), 'single');
171+
$option->option_value = esc_html(maybe_unserialize($option->option_value), 'single');
172172
} else {
173173
$option->option_value = "SERIALIZED DATA";
174174
$disabled = ' disabled="disabled"';
@@ -210,7 +210,7 @@
210210
$allowed_themes = array_keys( $themes );
211211
$out = '';
212212
foreach ( $themes as $key => $theme ) {
213-
$theme_key = wp_specialchars( $theme['Stylesheet'] );
213+
$theme_key = esc_html( $theme['Stylesheet'] );
214214
if ( ! isset($allowed_themes[$theme_key] ) ) {
215215
$checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : '';
216216
$out .= '<tr class="form-field form-required">
@@ -253,7 +253,7 @@
253253
<td>
254254
<select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php
255255
foreach ( $editblog_roles as $role => $role_assoc ){
256-
$name = translate_with_context($role_assoc['name']);
256+
$name = translate_user_role($role_assoc['name']);
257257
$selected = ( $role == $existing_role ) ? 'selected="selected"' : '';
258258
echo "<option {$selected} value=\"" . esc_attr($role) . "\">{$name}</option>";
259259
}

wp-admin/ms-themes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
$class = '';
3838
foreach ( (array) $themes as $key => $theme ) {
3939
$total_theme_count++;
40-
$theme_key = wp_specialchars($theme['Stylesheet']);
40+
$theme_key = esc_html($theme['Stylesheet']);
4141
$class = ('alt' == $class) ? '' : 'alt';
4242
$class1 = $enabled = $disabled = '';
4343

wp-admin/user-edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function use_ssl_preference($user) {
7070
$new_email = get_option( $current_user->ID . '_new_email' );
7171
if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
7272
$user->ID = $current_user->ID;
73-
$user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) );
73+
$user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) );
7474
if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) )
7575
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );
7676
wp_update_user( get_object_vars( $user ) );

0 commit comments

Comments
 (0)