aboutsummaryrefslogtreecommitdiff
path: root/app/fn
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-28 20:18:17 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-28 20:24:52 +0200
commit9090550d241f9f7b3246b24bfd323bd988add749 (patch)
tree2c2de66510533da53848dd876a9ab392471b38b8 /app/fn
parent98514a4e0037aa0879e45bbad660aeda8837c624 (diff)
downloadwcms-9090550d241f9f7b3246b24bfd323bd988add749.tar.gz
wcms-9090550d241f9f7b3246b24bfd323bd988add749.zip
listen to brother Stan and clean some things
Diffstat (limited to 'app/fn')
-rw-r--r--app/fn/fn.php13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php
index afadae8..103062a 100644
--- a/app/fn/fn.php
+++ b/app/fn/fn.php
@@ -1,6 +1,6 @@
<?php
-use Wcms\Medialist;
+use Wcms\Mediaopt;
use function Clue\StreamFilter\fun;
@@ -91,11 +91,9 @@ function arrayclean($input)
* Clean string from characters outside `[0-9a-z-_]` and troncate it
* @param string $input
* @param int $max minmum input length to trucate id
- * @param int $min minimum output length to send error message
* @return string output formated id
- * @throws \RuntimeException If ID length is inverior to minimal length
*/
-function idclean(string $input, int $max = Wcms\Model::MAX_ID_LENGTH, int $min = 0): string
+function idclean(string $input, int $max = Wcms\Model::MAX_ID_LENGTH): string
{
$regex = '%[^a-z0-9-_]%';
$input = urldecode($input);
@@ -109,11 +107,6 @@ function idclean(string $input, int $max = Wcms\Model::MAX_ID_LENGTH, int $min =
$input = substr($input, 0, $max);
}
-
- if (strlen($input) < $min) {
- throw new \RuntimeException("Id length cant be inferior to $min");
- }
-
return $input;
}
@@ -261,7 +254,7 @@ function treecount(
int $deepness,
string $path,
string $currentdir,
- Medialist $mediaopt
+ Mediaopt $mediaopt
) {
if ($path . '/' === $currentdir) {
$folder = '├─📂<span id="currentdir">' . $dirname . '<span>';