Plugin Directory

Changeset 1479829


Ignore:
Timestamp:
08/21/2016 06:02:50 AM (10 years ago)
Author:
safly
Message:

Bug Fix: Some bugfixes

Location:
safly-cloud-protection/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • safly-cloud-protection/trunk/core/safly-interact.php

    r1479569 r1479829  
    1313    //Excluded Spiders UA
    1414    //Pass
     15    $SaFly_If_Footer = '0';
    1516}elseif (SaFly_Exclude_Keyword(base64_decode(SaFly_Current_URL()), $safly_options['exclude_url_keyword'])) {
    1617    //Excluded keywords
     
    5657
    5758/* Pages Adding */
    58 add_action('wp_footer', 'SaFly_add_Footer_Frames');
     59if (isset($SaFly_If_Footer) && $SaFly_If_Footer == '0') {
     60    //No Footer Added
     61}else {
     62    add_action('wp_footer', 'SaFly_add_Footer_Frames');
     63}
    5964
    6065?>
  • safly-cloud-protection/trunk/options.php

    r1479569 r1479829  
    192192        //Update the API Server
    193193        $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);
    195195        update_option('safly_api_server_url', $safly_api_server_url);
    196196        //Update the trigger
     
    237237        $safly_options_saflywafserver = $_POST['saflywafserver'];
    238238        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.');     
    240240        $safly_options['level']          = $safly_options_level;
    241241        $safly_options['saflywafserver'] = $safly_options_saflywafserver;
  • safly-cloud-protection/trunk/wrapper.php

    r1479548 r1479829  
    211211}
    212212
    213 function SaFly_Get_API_Code($tolerance=on)
     213function SaFly_Get_API_Code($tolerance = 'on')
    214214{
    215215    global $safly_api_domain, $saflysalt, $saflysign;
     
    256256}
    257257
    258 function SaFly_Options_If_API_Domain($str, $notice = 'Wrong API Server.')
     258function SaFly_Options_If_API_Server($str, $notice = 'Invalid API Server.')
    259259{
    260260    if (!empty($str)) {
     
    273273}
    274274
     275function 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
    275292function SaFly_Trigger_VALIDATE($trigger)
    276293{
     
    289306function SaFly_Number_VALIDATE($number)
    290307{
    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        }
    293312    }
    294313}
Note: See TracChangeset for help on using the changeset viewer.