Taxonomy/Users: Provide a fallback for incorrect HTTP referrers.

Merge of [41398] to the 4.6 branch.

Built from https://develop.svn.wordpress.org/branches/4.6@41419


git-svn-id: http://core.svn.wordpress.org/branches/4.6@41252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2017-09-19 11:12:41 +00:00
parent f12b16a291
commit acd952f9c7
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
<div id="message" class="updated"> <div id="message" class="updated">
<p><strong><?php echo $message; ?></strong></p> <p><strong><?php echo $message; ?></strong></p>
<?php if ( $wp_http_referer ) { ?> <?php if ( $wp_http_referer ) { ?>
<p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php <p><a href="<?php echo esc_url( wp_validate_redirect( wp_sanitize_redirect( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"><?php
/* translators: %s: taxonomy name */ /* translators: %s: taxonomy name */
printf( _x( '&larr; Back to %s', 'admin screen' ), $tax->labels->name ); printf( _x( '&larr; Back to %s', 'admin screen' ), $tax->labels->name );
?></a></p> ?></a></p>

View File

@ -181,7 +181,7 @@ include(ABSPATH . 'wp-admin/admin-header.php');
<p><strong><?php _e('User updated.') ?></strong></p> <p><strong><?php _e('User updated.') ?></strong></p>
<?php endif; ?> <?php endif; ?>
<?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?> <?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?>
<p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('&larr; Back to Users'); ?></a></p> <p><a href="<?php echo esc_url( wp_validate_redirect( wp_sanitize_redirect( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e('&larr; Back to Users'); ?></a></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>