Changeset 3415496
- Timestamp:
- 12/09/2025 02:07:58 PM (5 days ago)
- File:
-
- 1 edited
-
eelv-redirection/trunk/eelv_redirection.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eelv-redirection/trunk/eelv_redirection.php
r3415486 r3415496 29 29 return false; 30 30 } 31 if(defined('REDIRECT_ALLOW_USER_AGENT') && strstr($_SERVER['HTTP_USER_AGENT'], REDIRECT_ALLOW_USER_AGENT)){31 if(defined('REDIRECT_ALLOW_USER_AGENT') && isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], REDIRECT_ALLOW_USER_AGENT)){ 32 32 @header("X-Redirect-Debug: Allowed by user-agent pattern", true); 33 33 return false; 34 34 } 35 return ($dir!='wp-admin' && $dir!='network' && !preg_match('#^/wp-(.*).php#', $_SERVER['SCRIPT_NAME']));35 return ($dir!='wp-admin' && $dir!='network' && isset($_SERVER['SCRIPT_NAME']) && !preg_match('#^/wp-(.*).php#', $_SERVER['SCRIPT_NAME'])); 36 36 } 37 37 38 38 function get_redirect_url(){ 39 39 $redirect_url = get_option('eelv_url_redirect'); 40 if(strstr($redirect_url, '%query_string%') ){41 $redirect_url =str_replace('%query_string%', $_SERVER['QUERY_STRING'], $redirect_url);40 if(strstr($redirect_url, '%query_string%') && isset($_SERVER['QUERY_STRING'])){ 41 $redirect_url =str_replace('%query_string%', sanitize_text_field($_SERVER['QUERY_STRING']), $redirect_url); 42 42 } 43 if(strstr($redirect_url, '%request_uri%') ){44 $redirect_url =str_replace('%request_uri%', $_SERVER['REQUEST_URI'], $redirect_url);43 if(strstr($redirect_url, '%request_uri%') && isset($_SERVER['REQUEST_URI'])){ 44 $redirect_url =str_replace('%request_uri%', sanitize_text_field($_SERVER['REQUEST_URI']), $redirect_url); 45 45 } 46 46 return $redirect_url; … … 90 90 // If they did, this hidden field will be set to 'Y' 91 91 if( isset($_POST[ 'eelv_url_redirect' ])) { 92 if (wp_verify_nonce( $_REQUEST['_wpnonce'], 'eelv_redirection_settings')){92 if (wp_verify_nonce( sanitize_text_field($_REQUEST['_wpnonce']), 'eelv_redirection_settings')){ 93 93 update_option( 'eelv_url_redirect', esc_url_raw(filter_input(INPUT_POST, 'eelv_url_redirect', FILTER_SANITIZE_URL))); 94 update_option( "eelv_code_redirect", sanitize_text_field($_POST[ 'eelv_code_redirect' ] ));95 update_option( "eelv_when_redirect", sanitize_text_field($_POST[ 'eelv_when_redirect' ] ));94 update_option( "eelv_code_redirect", sanitize_text_field($_POST[ 'eelv_code_redirect' ] ?? '')); 95 update_option( "eelv_when_redirect", sanitize_text_field($_POST[ 'eelv_when_redirect' ] ?? '')); 96 96 ?> 97 <div class="updated"><p><strong><?php e cho esc_html(__('Option saved','eelv-redirection'))?></strong></p></div>97 <div class="updated"><p><strong><?php esc_html_e('Option saved','eelv-redirection'); ?></strong></p></div> 98 98 <?php 99 99 }else{ 100 100 ?> 101 <div class="error"><p><strong><?php e cho esc_html(__('Warning there has been a hacking attempt','eelv-redirection'))?></strong></p></div>101 <div class="error"><p><strong><?php esc_html_e('Warning there has been a hacking attempt','eelv-redirection'); ?></strong></p></div> 102 102 <?php 103 103 }
Note: See TracChangeset
for help on using the changeset viewer.