Plugin Directory

Changeset 3362225


Ignore:
Timestamp:
09/16/2025 06:12:21 AM (6 months ago)
Author:
bitslip6
Message:

2 warning fixes

Location:
bitfire/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bitfire/trunk/bitfire-plugin.php

    r3362211 r3362225  
    253253
    254254
     255    // make sure important WordPress calls are legitimate
     256    // TODO: improve this by integrating to the main inspection engine
     257    if (function_exists('BitFirePRO\wp_requirement_check') && !wp_requirement_check()) {
     258        $request = $ins->_request;
     259        block_now(31001, "referer", $request->referer, "new-user.php", 0)->run();
     260    }
     261
     262
    255263    // TODO: move this to -admin
    256264    if (CFG::enabled("pro_mfa") && function_exists("\BitFirePRO\sms")) {
     
    591599}
    592600
    593 // make sure important WordPress calls are legitimate
    594 // TODO: improve this by integrating to the main inspection engine
    595 if (function_exists('BitFirePRO\wp_requirement_check') && !wp_requirement_check()) {
    596     $request = $ins->_request;
    597 
    598     block_now(31001, "referer", $request->referer, "new-user.php", 0)->run();
    599 }
    600 
    601601
    602602// keep the config file synced with the current WordPress install
  • bitfire/trunk/src/util.php

    r3362088 r3362225  
    438438    return ($j == false) ? "" : $j;
    439439}
    440 function contains(?string $haystack, $needle) : bool { if(is_array($needle)) { foreach ($needle as $n) { if (!empty($n) && strpos($haystack, $n) !== false) { return true; } } return false; } else { return strpos($haystack, $needle) !== false; } }
     440function contains(?string $haystack, $needle) : bool { if (empty($haystack) || empty($needle)) { return false; } if(is_array($needle)) { foreach ($needle as $n) { if (!empty($n) && strpos($haystack, $n) !== false) { return true; } } return false; } else { return strpos($haystack, $needle) !== false; } }
    441441function icontains(?string $haystack, $needle) : bool { if(is_array($needle)) { foreach ($needle as $n) { if (!empty($n) && stripos($haystack, $n) !== false) { return true; } } return false; } else { return stripos($haystack, $needle) !== false; } }
    442442// return the $index element of $input split by $separator or '' on any failure
Note: See TracChangeset for help on using the changeset viewer.