bug fixes in tags

This commit is contained in:
Diego Najar 2021-09-23 18:51:07 +02:00
parent 09fbbbb599
commit 452e621cb2
4 changed files with 10 additions and 4 deletions

View file

@ -39,5 +39,5 @@ PHPStan
-------
https://phpstan.org/
```
docker run --rm -v $(pwd):/app ghcr.io/phpstan/phpstan:0.12.96 analyse -c /app/phpstan.neon /app
docker run --rm -v $(pwd):/app ghcr.io/phpstan/phpstan:0.12.99 analyse -c /app/phpstan.neon /app
```

View file

@ -625,7 +625,7 @@
<select id="tags" size="5" class="form-select" multiple aria-label="multiple select">
<?php
foreach ($tags->db as $key => $fields) {
echo '<option value="' . $key . '" ' . ($pageKey && in_array($key, $page->tags(true)) ? 'selected' : '') . '>' . $fields['name'] . '</option>';
echo '<option value="' . $fields['name'] . '" ' . ($pageKey && array_key_exists($key, $page->tags(true)) ? 'selected' : '') . '>' . $fields['name'] . '</option>';
}
?>
</select>

View file

@ -306,4 +306,10 @@ class Text {
return intval($value) * ($s[strtolower(substr($value,-1))] ?: 1);
}
public static function generateSlug(string $text): string {
$text = trim($text);
$slug = self::cleanUrl($text);
return $slug;
}
}

View file

@ -1,9 +1,9 @@
parameters:
#phpVersion: 70100 # PHP 7.1 - https://github.com/phpstan/phpstan/blob/master/playground-api/handler.ts#L38
phpVersion: 70100 # PHP 7.1 - https://github.com/phpstan/phpstan/blob/master/playground-api/handler.ts#L38
#phpVersion: 70200 # PHP 7.2
#phpVersion: 70300 # PHP 7.3
#phpVersion: 70400 # PHP 7.4
phpVersion: 80000 # PHP 8.0
#phpVersion: 80000 # PHP 8.0
level: 0
excludePaths:
analyse: