Changeset 1479829
- Timestamp:
- 08/21/2016 06:02:50 AM (10 years ago)
- Location:
- safly-cloud-protection/trunk
- Files:
-
- 3 edited
-
core/safly-interact.php (modified) (2 diffs)
-
options.php (modified) (2 diffs)
-
wrapper.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
safly-cloud-protection/trunk/core/safly-interact.php
r1479569 r1479829 13 13 //Excluded Spiders UA 14 14 //Pass 15 $SaFly_If_Footer = '0'; 15 16 }elseif (SaFly_Exclude_Keyword(base64_decode(SaFly_Current_URL()), $safly_options['exclude_url_keyword'])) { 16 17 //Excluded keywords … … 56 57 57 58 /* Pages Adding */ 58 add_action('wp_footer', 'SaFly_add_Footer_Frames'); 59 if (isset($SaFly_If_Footer) && $SaFly_If_Footer == '0') { 60 //No Footer Added 61 }else { 62 add_action('wp_footer', 'SaFly_add_Footer_Frames'); 63 } 59 64 60 65 ?> -
safly-cloud-protection/trunk/options.php
r1479569 r1479829 192 192 //Update the API Server 193 193 $safly_api_server_url = $_POST['saflyapiserverurl']; 194 SaFly_Options_If_API_ Domain($safly_api_server_url);194 SaFly_Options_If_API_Server($safly_api_server_url); 195 195 update_option('safly_api_server_url', $safly_api_server_url); 196 196 //Update the trigger … … 237 237 $safly_options_saflywafserver = $_POST['saflywafserver']; 238 238 SaFly_Level_VALIDATE($safly_options_level); 239 SaFly_Options_If_API_ Domain($safly_options_saflywafserver, 'Invalid WAF Server.');239 SaFly_Options_If_API_Server($safly_options_saflywafserver, 'Invalid WAF Server.'); 240 240 $safly_options['level'] = $safly_options_level; 241 241 $safly_options['saflywafserver'] = $safly_options_saflywafserver; -
safly-cloud-protection/trunk/wrapper.php
r1479548 r1479829 211 211 } 212 212 213 function SaFly_Get_API_Code($tolerance =on)213 function SaFly_Get_API_Code($tolerance = 'on') 214 214 { 215 215 global $safly_api_domain, $saflysalt, $saflysign; … … 256 256 } 257 257 258 function SaFly_Options_If_API_ Domain($str, $notice = 'WrongAPI Server.')258 function SaFly_Options_If_API_Server($str, $notice = 'Invalid API Server.') 259 259 { 260 260 if (!empty($str)) { … … 273 273 } 274 274 275 function SaFly_Options_If_API_Domain($str, $notice = 'Invalid API Domain.') 276 { 277 if (!empty($str)) { 278 if (function_exists(esc_url)) { 279 $str = esc_url($str); 280 $tempu = parse_url($str); 281 $str = $tempu['host']; 282 } 283 if (!preg_match('/(\w){1,63}(\.(\w){1,63}){1,5}$/', $str)) { 284 wp_die($notice, 'SaFly Cloud Protection'); 285 }elseif (strlen($str) > 50) { 286 wp_die($notice, 'SaFly Cloud Protection'); 287 } 288 } 289 return $str; 290 } 291 275 292 function SaFly_Trigger_VALIDATE($trigger) 276 293 { … … 289 306 function SaFly_Number_VALIDATE($number) 290 307 { 291 if (!preg_match('/^(\w)+$/', $number)) { 292 wp_die('Invalid Numbers.', 'SaFly Cloud Protection'); 308 if (!empty($number)) { 309 if (!preg_match('/^(\w)+$/', $number)) { 310 wp_die('Invalid Numbers.', 'SaFly Cloud Protection'); 311 } 293 312 } 294 313 }
Note: See TracChangeset
for help on using the changeset viewer.