Updated Composer packages; empty field fix

Composer dependencies were pretty old, so they needed to be upgraded to
the latest.

There was also a minor bug that was triggered when a new page was saved
with empty tags and no images or documents, so that's been patched as
well.
This commit is contained in:
Ro 2023-04-09 17:16:24 -07:00
parent f1850ce7f7
commit 4876c1336e
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
5 changed files with 280 additions and 245 deletions

View file

@ -120,9 +120,14 @@ class DashControl
} else {
$views = (new Themes())->getCustomViews();
}
$imageList = [];
$fileList = [];
if (isset($page['feature'])) {
$imageList = explode(',', $page['feature']);
}
if (isset($page['files'])) {
$fileList = explode(',', $page['files']);
}
$images = [];
$files = [];

View file

@ -108,9 +108,13 @@ class Contents
];
$sanitizer = $builder->build($detergent);
$scrubbed = $sanitizer->sanitize($result->getContent());
if (isset($meta['feature'])) {
$featureList = explode(',', $meta['feature']);
} else {
$featureList = "";
}
$docs = '';
if (isset($meta['files'])) {
$fileList = explode(',', $meta['files']);
@ -122,6 +126,7 @@ class Contents
$media = [];
$files = [];
if ($featureList != '') {
foreach ($featureList as $file) {
$item = trim($file);
$ext = pathinfo($item, PATHINFO_EXTENSION);
@ -129,7 +134,9 @@ class Contents
array_push($media, ['file' => $item, 'type' => trim($ext)]);
}
}
}
if ($fileList != "") {
foreach ($fileList as $file) {
$item = trim($file);
$ext = pathinfo($item, PATHINFO_EXTENSION);
@ -137,6 +144,7 @@ class Contents
array_push($files, ['file' => $item, 'type' => trim($ext)]);
}
}
}
//sort attributes into page object
$page = [

View file

@ -23,6 +23,7 @@ class Sorting
$pages = (new Book('../content/pages'))->getContents();
foreach ($pages as $page) {
$temp = [];
if (isset($page['tags'])) {
$temp = explode(',', $page['tags']);
foreach ($temp as $tag) {
$label = trim($tag);
@ -35,6 +36,7 @@ class Sorting
}
}
}
}
return self::$p_tags;
}
@ -43,6 +45,7 @@ class Sorting
{
$tagged = [];
foreach ($pages as $page) {
if (isset($page['tags'])) {
if (strpos($page['tags'], $tag) !== false) {
array_push($tagged, [
'title' => $page['title'],
@ -52,6 +55,7 @@ class Sorting
]);
}
}
}
return $tagged;
}
@ -124,9 +128,9 @@ class Sorting
'image' => $settings['global']['base_url'] . $settings['global']['background'],
'baseURL' => $settings['global']['base_url'],
];
$taglist = explode(',', $page['tags']);
$tags = [];
if (isset($page['tags'])) {
$taglist = explode(',', $page['tags']);
foreach ($taglist as $tag) {
$label = trim($tag);
array_push($tags, [
@ -134,6 +138,7 @@ class Sorting
'slug' => StringTools::safeString($label),
]);
}
}
$meta = [
'who' => $page['author'],

View file

@ -1,7 +1,7 @@
{
"name": "are0h/fipamo",
"descriptions": "The most chill no database blog framework ever.",
"version": "2.5.1-beta",
"version": "2.6.0-beta",
"homepage": "https://fipamo.blog",
"authors": [
{
@ -10,9 +10,9 @@
}
],
"support": {
"source": "https://code.playvicio.us/Are0h/Fipamo",
"wiki": "https://code.playvicio.us/Are0h/Fipamo/wiki/_pages",
"issues": "https://code.playvicio.us/Are0h/Fipamo/issues"
"source": "https://koodu.ubiqueros.com/are0h/Fipamo",
"wiki": "https://koodu.ubiqueros.com/are0h/Fipamo/wiki/?action=_pages",
"issues": "https://koodu.ubiqueros.com/are0h/Fipamo/issues"
},
"require": {
"slim/slim": "4.*",
@ -28,5 +28,10 @@
"symfony/yaml": "^5.4",
"olegatro/html-sanitizer-relative": "^1.0",
"nesbot/carbon": "^2.62"
},
"scripts": {
"start": [
"@php -S localhost:8000 -t public/"
]
}
}

410
composer.lock generated

File diff suppressed because it is too large Load diff