Skip to content

Commit

Permalink
e2guardian - fix backport function tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcello Coutinho committed Jul 23, 2023
1 parent f9434aa commit b960d93
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg-e2guardian5/files/usr/local/pkg/e2guardian.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,25 @@ $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
require_once("xmlrpc_client.inc");

/*Chamadas array*/

function bp_in_array($field, $array) {
if (! function_exists("bp_in_array")) {
function bp_in_array($field, $array) {
if (is_array($array)) {
return in_array($field,$array);
} else {
return false;
}
}
}

function bp_array_key_exists($field, $array) {
if (! function_exists("bp_array_key_exists")) {

function bp_array_key_exists($field, $array) {
if (is_array($array)) {
return array_key_exists($field,$array);
} else {
return false;
}
}
}

if (version_compare(PHP_VERSION, "7.3") < 0 && !function_exists("is_countable")) {
Expand All @@ -72,6 +76,9 @@ if ($_POST['clear_cert_cache'] == 'clear_cert_cache') {
}

function e2g_delTree($dir) {
if (! is_dir($dir)) {
return false;
}
//at least two slashes, two dirs and 10 char long
if(preg_match("@/\w+/\w+@", $dir) && strlen($dir) > 10) {
$files = array_diff(scandir($dir), array('.', '..'));
Expand Down

0 comments on commit b960d93

Please sign in to comment.