diff options
author | n-peugnet <n.peugnet@free.fr> | 2020-12-19 19:52:59 +0100 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2020-12-19 19:52:59 +0100 |
commit | d2bbcab233dabe3b04f8c3b94a947ec174540418 (patch) | |
tree | 8ed06c1b412cc20f899686738a49bef6b1ead7d8 /app/fn | |
parent | 9338d030f38b465be5f6307f5ee6f2e20d904856 (diff) | |
download | wcms-d2bbcab233dabe3b04f8c3b94a947ec174540418.tar.gz wcms-d2bbcab233dabe3b04f8c3b94a947ec174540418.zip |
run phpcbf and add fix target to Makefile
Diffstat (limited to 'app/fn')
-rw-r--r-- | app/fn/fn.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php index e0e5f47..844518a 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -102,9 +102,9 @@ function idclean(string $input, int $max = Wcms\Model::MAX_ID_LENGTH): string $search = ['é', 'à', 'è', 'ç', 'ù', 'ï', 'î', ' ']; $replace = ['e', 'a', 'e', 'c', 'u', 'i', 'i', '-']; $input = str_replace($search, $replace, $input); - + $input = preg_replace($regex, '', strtolower(trim($input))); - + $input = substr($input, 0, $max); } return $input; @@ -439,14 +439,14 @@ function accessfile(string $path, bool $createdir = false): bool function file_upload_max_size() { static $max_size = -1; - + if ($max_size < 0) { // Start with post_max_size. $post_max_size = parse_size(ini_get('post_max_size')); if ($post_max_size > 0) { $max_size = $post_max_size; } - + // If upload_max_size is less, then reduce. Except if upload_max_size is // zero, which indicates no limit. $upload_max = parse_size(ini_get('upload_max_filesize')); @@ -456,7 +456,7 @@ function file_upload_max_size() } return $max_size; } - + function parse_size($size) { $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. |