get_status_header_desc( 301 ),
302 => get_status_header_desc( 302 ),
307 => get_status_header_desc( 307 ),
308 => get_status_header_desc( 308 ),
);
?>
:
: regex === true ) echo ' checked="checked"' ?>/>
:
$code ) : ?>
action_code ) ) echo ' selected="selected"' ?>>
:
matched target URL as the address to send visitors if they do match, and not matched if they don\'t match. Leaving a URL blank means that the visitor is not redirected.', 'redirection' ); ?>
url_from ) > 0 ) : ?>
:
:
url_notfrom ) > 0 ) : ?>
:
:
sanitize_url( $details['target'] );
return array(
'url_from' => $this->sanitize_url( $details['url_from'] ),
'url_notfrom' => isset( $details['url_notfrom'] ) ? $this->sanitize_url( $details['url_notfrom'] ) : false,
'regex' => isset( $details['regex'] ) ? true : false,
'referrer' => isset( $details['referrer'] ) ? $this->sanitize_referrer( $details['referrer'] ) : false,
);
}
public function sanitize_referrer( $agent ) {
return $this->sanitize_url( $agent );
}
function initialize( $url ) {
$this->url = array( $url, '' );
}
function wants_it() {
// Match referrer
return true;
}
function get_target( $url, $matched_url, $regex ) {
$target = false;
// Check if referrer matches
if ( ( $this->regex === false && $_SERVER['HTTP_REFERER'] === $this->referrer ) || ( $this->regex === true && preg_match( '@'.str_replace( '@', '\\@', $this->referrer ).'@', $_SERVER['HTTP_REFERER'], $matches ) ) ) {
$target = $this->url_from;
if ( $regex )
$target = preg_replace( '@'.str_replace( '@', '\\@', $matched_url ).'@', $target, $url );
}
elseif ( $this->url_notfrom !== '' )
$target = $this->url_notfrom;
return $target;
}
function match_name() {
return sprintf( 'referrer - %s', $this->referrer );
}
}