Changeset 12237
- Timestamp:
- 11/11/2022 03:36:41 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/class-wporg-sso.php
r12232 r12237 221 221 */ 222 222 protected function _safe_redirect( $to, $status = 302 ) { 223 if ( headers_sent() ) {224 return;225 }226 223 227 224 // When available, sanitize the redirect prior to redirecting. … … 238 235 if ( function_exists( 'apply_filters' ) ) { 239 236 $to = apply_filters( 'wp_redirect', $to, $status ); 237 } 238 239 // In the event headers have been sent already, output a HTML redirect. 240 if ( headers_sent() ) { 241 if ( function_exists( 'esc_url' ) ) { 242 $to = esc_url( $to ); 243 } else { 244 // This is not a replacement for esc_url(). 245 $to = htmlspecialchars( $to, ENT_QUOTES | ENT_SUBSTITUTE ); 246 } 247 248 printf( 249 '<meta http-equiv="refresh" content="1;url=%1$s" />' . 250 '<a href="%1$s">%1$s</a>', 251 $to 252 ); 253 exit; 240 254 } 241 255 … … 245 259 preg_match( '/^30(1|2)$/', $status ) ? $status : 302 246 260 ); 247 248 die(); 261 exit; 249 262 } 250 263 }
Note: See TracChangeset
for help on using the changeset viewer.