IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1261 | 1261 | } |
1262 | 1262 | endif; |
1263 | 1263 | |
1264 | | if ( !function_exists('wp_safe_redirect') ) : |
| 1264 | if ( ! function_exists( 'wp_safe_redirect' ) ) : |
1265 | 1265 | /** |
1266 | 1266 | * Performs a safe (local) redirect, using wp_redirect(). |
1267 | 1267 | * |
… |
… |
|
1276 | 1276 | * @since 2.3.0 |
1277 | 1277 | * |
1278 | 1278 | * @param string $location The path to redirect to. |
1279 | | * @param int $status Status code to use. |
| 1279 | * @param int $status Status code to use. |
| 1280 | * |
| 1281 | * @return bool $redirect Pass the return from wp_redirect on |
1280 | 1282 | */ |
1281 | | function wp_safe_redirect($location, $status = 302) { |
| 1283 | function wp_safe_redirect( $location, $status = 302 ) { |
1282 | 1284 | |
1283 | 1285 | // Need to look at the URL the way it will end up in wp_redirect() |
1284 | | $location = wp_sanitize_redirect($location); |
| 1286 | $location = wp_sanitize_redirect( $location ); |
1285 | 1287 | |
1286 | 1288 | /** |
1287 | 1289 | * Filters the redirect fallback URL for when the provided redirect is not safe (local). |
… |
… |
|
1289 | 1291 | * @since 4.3.0 |
1290 | 1292 | * |
1291 | 1293 | * @param string $fallback_url The fallback URL to use by default. |
1292 | | * @param int $status The redirect status. |
| 1294 | * @param int $status The redirect status. |
1293 | 1295 | */ |
1294 | 1296 | $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) ); |
1295 | 1297 | |
1296 | | wp_redirect($location, $status); |
| 1298 | return wp_redirect( $location, $status ); |
1297 | 1299 | } |
1298 | 1300 | endif; |
1299 | 1301 | |