aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2024-12-01 18:09:09 +0100
committerThomas Lange <code@nerdmind.de>2024-12-01 19:50:22 +0100
commit2ac4bdca2ab38990f891371282a3a17af290e78f (patch)
tree4383257740b3a4ae1800ac989d24234eefc0d8c2
parentebc5cf9ac20b959c6d4a6a34643eb8657cf9db84 (diff)
downloadblog-2ac4bdca2ab38990f891371282a3a17af290e78f.tar.gz
blog-2ac4bdca2ab38990f891371282a3a17af290e78f.tar.xz
blog-2ac4bdca2ab38990f891371282a3a17af290e78f.zip
PHP Keywords and types should be in lowercase
Follow PSR-12 and use lowercase variants of PHP reserved keywords. See: https://www.php-fig.org/psr/psr-12/#25-keywords-and-types Find all uppercase occurrences of "or", "and", "null", "true" and "false" and change them to the lowercase variant.
-rw-r--r--admin/auth.php2
-rw-r--r--admin/category/delete.php4
-rw-r--r--admin/category/index.php8
-rw-r--r--admin/category/insert.php12
-rw-r--r--admin/category/update.php12
-rw-r--r--admin/database.php8
-rw-r--r--admin/index.php10
-rw-r--r--admin/page/delete.php4
-rw-r--r--admin/page/index.php6
-rw-r--r--admin/page/insert.php10
-rw-r--r--admin/page/search.php4
-rw-r--r--admin/page/update.php10
-rw-r--r--admin/post/delete.php4
-rw-r--r--admin/post/index.php6
-rw-r--r--admin/post/insert.php12
-rw-r--r--admin/post/search.php4
-rw-r--r--admin/post/update.php12
-rw-r--r--admin/user/delete.php4
-rw-r--r--admin/user/index.php6
-rw-r--r--admin/user/insert.php16
-rw-r--r--admin/user/update.php16
-rw-r--r--core/application.php34
-rw-r--r--core/functions.php12
-rw-r--r--core/include/category/list.php6
-rw-r--r--core/include/category/main.php6
-rw-r--r--core/include/page/list.php4
-rw-r--r--core/include/post/list.php4
-rw-r--r--core/include/search/main.php2
-rw-r--r--core/include/user/list.php4
-rw-r--r--core/namespace/Application.php12
-rw-r--r--core/namespace/Factory.php2
-rw-r--r--core/namespace/HTTP.php38
-rw-r--r--core/namespace/Language.php4
-rw-r--r--core/namespace/Migrator.php2
-rw-r--r--core/namespace/ORM/Entity.php2
-rw-r--r--core/namespace/ORM/Repositories/CategoryRepository.php4
-rw-r--r--core/namespace/ORM/Repository.php10
-rw-r--r--core/namespace/ORM/RepositorySearch.php6
-rw-r--r--core/namespace/Parsers/ArgumentParser.php4
-rw-r--r--core/namespace/Parsers/MarkdownParser.php2
-rw-r--r--core/namespace/Router.php6
-rw-r--r--core/namespace/Template/Template.php2
-rw-r--r--core/script/convert_content_tags.php10
-rw-r--r--theme/admin/html/category/form.php2
-rw-r--r--theme/admin/html/main.php6
-rw-r--r--theme/admin/html/post/form.php2
-rw-r--r--theme/admin/html/post/search.php2
-rw-r--r--theme/default/html/main.php4
48 files changed, 181 insertions, 181 deletions
diff --git a/admin/auth.php b/admin/auth.php
index 68b07a4..3b272f0 100644
--- a/admin/auth.php
+++ b/admin/auth.php
@@ -2,7 +2,7 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
+const ADMINISTRATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/category/delete.php b/admin/category/delete.php
index c443c4a..167067e 100644
--- a/admin/category/delete.php
+++ b/admin/category/delete.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/category/index.php b/admin/category/index.php
index 35a78c3..fd7eef6 100644
--- a/admin/category/index.php
+++ b/admin/category/index.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -33,7 +33,7 @@ if($count === 0) {
HTTP::redirect(Application::getAdminURL('category/insert.php'));
}
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
@@ -44,7 +44,7 @@ $categories = $CategoryRepository->getPaginatedTree(
$site_size, ($currentSite-1) * $site_size);
foreach($categories as $Category) {
- $templates[] = generateCategoryItemTemplate($Category, TRUE);
+ $templates[] = generateCategoryItemTemplate($Category, true);
}
#===============================================================================
diff --git a/admin/category/insert.php b/admin/category/insert.php
index c63ad06..d68aa72 100644
--- a/admin/category/insert.php
+++ b/admin/category/insert.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -24,11 +24,11 @@ $Category = new ORM\Entities\Category;
# Check for insert request
#===============================================================================
if(HTTP::issetPOST('insert')) {
- $Category->set('parent', HTTP::POST('parent') ?: NULL);
+ $Category->set('parent', HTTP::POST('parent') ?: null);
$Category->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Category->set('name', HTTP::POST('name') ?: NULL);
- $Category->set('body', HTTP::POST('body') ?: NULL);
- $Category->set('argv', HTTP::POST('argv') ?: NULL);
+ $Category->set('name', HTTP::POST('name') ?: null);
+ $Category->set('body', HTTP::POST('body') ?: null);
+ $Category->set('argv', HTTP::POST('argv') ?: null);
$Category->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Category->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/category/update.php b/admin/category/update.php
index c3d9812..80423c8 100644
--- a/admin/category/update.php
+++ b/admin/category/update.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -27,15 +27,15 @@ if(!$Category = $CategoryRepository->find(HTTP::GET('id'))) {
#===============================================================================
if(HTTP::issetPOST('update')) {
$Category->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Category->set('name', HTTP::POST('name') ?: NULL);
- $Category->set('body', HTTP::POST('body') ?: NULL);
- $Category->set('argv', HTTP::POST('argv') ?: NULL);
+ $Category->set('name', HTTP::POST('name') ?: null);
+ $Category->set('body', HTTP::POST('body') ?: null);
+ $Category->set('argv', HTTP::POST('argv') ?: null);
$Category->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Category->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
# Modify parent field only if it is not a self-reference
if(HTTP::POST('parent') != $Category->getID()) {
- $Category->set('parent', HTTP::POST('parent') ?: NULL);
+ $Category->set('parent', HTTP::POST('parent') ?: null);
}
if(HTTP::issetPOST(['token' => Application::getSecurityToken()])) {
diff --git a/admin/database.php b/admin/database.php
index 1d3404f..fa37d1c 100644
--- a/admin/database.php
+++ b/admin/database.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -19,7 +19,7 @@ if(HTTP::issetPOST('command')) {
$Statement = $Database->query(HTTP::POST('command'));
do {
- $result[] = print_r($Statement->fetchAll(), TRUE);
+ $result[] = print_r($Statement->fetchAll(), true);
} while($Statement->nextRowset());
} catch(PDOException $Exception) {
$messages[] = $Exception->getMessage();
@@ -36,7 +36,7 @@ $DatabaseTemplate = Template\Factory::build('database');
$DatabaseTemplate->set('FORM', [
'INFO' => $messages ?? [],
'TOKEN' => Application::getSecurityToken(),
- 'RESULT' => implode(NULL, $result ?? []),
+ 'RESULT' => implode(null, $result ?? []),
'COMMAND' => HTTP::POST('command'),
]);
diff --git a/admin/index.php b/admin/index.php
index 09c126d..ca8bd5a 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -39,9 +39,9 @@ if($User = $UserRepository->getLast()) {
#===============================================================================
$HomeTemplate = Template\Factory::build('home');
$HomeTemplate->set('LAST', [
- 'PAGE' => $PageItemTemplate ?? FALSE,
- 'POST' => $PostItemTemplate ?? FALSE,
- 'USER' => $UserItemTemplate ?? FALSE
+ 'PAGE' => $PageItemTemplate ?? false,
+ 'POST' => $PostItemTemplate ?? false,
+ 'USER' => $UserItemTemplate ?? false
]);
$HomeTemplate->set('COUNT', [
diff --git a/admin/page/delete.php b/admin/page/delete.php
index 8542187..a0924c8 100644
--- a/admin/page/delete.php
+++ b/admin/page/delete.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/page/index.php b/admin/page/index.php
index 7586d3c..b533cf3 100644
--- a/admin/page/index.php
+++ b/admin/page/index.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -35,7 +35,7 @@ if(!$count) {
HTTP::redirect(Application::getAdminURL('page/insert.php'));
}
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
diff --git a/admin/page/insert.php b/admin/page/insert.php
index 915fee5..7577433 100644
--- a/admin/page/insert.php
+++ b/admin/page/insert.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -27,9 +27,9 @@ $Page = new ORM\Entities\Page;
if(HTTP::issetPOST('insert')) {
$Page->set('user', HTTP::POST('user'));
$Page->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Page->set('name', HTTP::POST('name') ?: NULL);
- $Page->set('body', HTTP::POST('body') ?: NULL);
- $Page->set('argv', HTTP::POST('argv') ?: NULL);
+ $Page->set('name', HTTP::POST('name') ?: null);
+ $Page->set('body', HTTP::POST('body') ?: null);
+ $Page->set('argv', HTTP::POST('argv') ?: null);
$Page->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Page->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/page/search.php b/admin/page/search.php
index c9a39cf..7310e2a 100644
--- a/admin/page/search.php
+++ b/admin/page/search.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/page/update.php b/admin/page/update.php
index 8f6cb0e..e123205 100644
--- a/admin/page/update.php
+++ b/admin/page/update.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -29,9 +29,9 @@ if(!$Page = $PageRepository->find(HTTP::GET('id'))) {
if(HTTP::issetPOST('update')) {
$Page->set('user', HTTP::POST('user'));
$Page->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Page->set('name', HTTP::POST('name') ?: NULL);
- $Page->set('body', HTTP::POST('body') ?: NULL);
- $Page->set('argv', HTTP::POST('argv') ?: NULL);
+ $Page->set('name', HTTP::POST('name') ?: null);
+ $Page->set('body', HTTP::POST('body') ?: null);
+ $Page->set('argv', HTTP::POST('argv') ?: null);
$Page->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Page->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/post/delete.php b/admin/post/delete.php
index 501cae4..6358af3 100644
--- a/admin/post/delete.php
+++ b/admin/post/delete.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/post/index.php b/admin/post/index.php
index 2da0f81..b25bde5 100644
--- a/admin/post/index.php
+++ b/admin/post/index.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -35,7 +35,7 @@ if(!$count) {
HTTP::redirect(Application::getAdminURL('post/insert.php'));
}
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
diff --git a/admin/post/insert.php b/admin/post/insert.php
index 1b04ecc..af70b1e 100644
--- a/admin/post/insert.php
+++ b/admin/post/insert.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -26,12 +26,12 @@ $Post = new ORM\Entities\Post;
# Check for insert request
#===============================================================================
if(HTTP::issetPOST('insert')) {
- $Post->set('category', HTTP::POST('category') ?: NULL);
+ $Post->set('category', HTTP::POST('category') ?: null);
$Post->set('user', HTTP::POST('user'));
$Post->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Post->set('name', HTTP::POST('name') ?: NULL);
- $Post->set('body', HTTP::POST('body') ?: NULL);
- $Post->set('argv', HTTP::POST('argv') ?: NULL);
+ $Post->set('name', HTTP::POST('name') ?: null);
+ $Post->set('body', HTTP::POST('body') ?: null);
+ $Post->set('argv', HTTP::POST('argv') ?: null);
$Post->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Post->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/post/search.php b/admin/post/search.php
index 5ec7ddc..2d29966 100644
--- a/admin/post/search.php
+++ b/admin/post/search.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/post/update.php b/admin/post/update.php
index 5241d38..e9736c9 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -28,12 +28,12 @@ if(!$Post = $PostRepository->find(HTTP::GET('id'))) {
# Check for update request
#===============================================================================
if(HTTP::issetPOST('update')) {
- $Post->set('category', HTTP::POST('category') ?: NULL);
+ $Post->set('category', HTTP::POST('category') ?: null);
$Post->set('user', HTTP::POST('user'));
$Post->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
- $Post->set('name', HTTP::POST('name') ?: NULL);
- $Post->set('body', HTTP::POST('body') ?: NULL);
- $Post->set('argv', HTTP::POST('argv') ?: NULL);
+ $Post->set('name', HTTP::POST('name') ?: null);
+ $Post->set('body', HTTP::POST('body') ?: null);
+ $Post->set('argv', HTTP::POST('argv') ?: null);
$Post->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$Post->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/user/delete.php b/admin/user/delete.php
index 1a7628c..64085a7 100644
--- a/admin/user/delete.php
+++ b/admin/user/delete.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
diff --git a/admin/user/index.php b/admin/user/index.php
index d2bee8d..fe7f1ab 100644
--- a/admin/user/index.php
+++ b/admin/user/index.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -34,7 +34,7 @@ if(!$count) {
HTTP::redirect(Application::getAdminURL('user/insert.php'));
}
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
diff --git a/admin/user/insert.php b/admin/user/insert.php
index c337e21..a943e13 100644
--- a/admin/user/insert.php
+++ b/admin/user/insert.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -25,12 +25,12 @@ $User = new ORM\Entities\User;
#===============================================================================
if(HTTP::issetPOST('insert')) {
$User->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('username')));
- $User->set('username', HTTP::POST('username') ?: NULL);
- $User->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : FALSE);
- $User->set('fullname', HTTP::POST('fullname') ?: NULL);
- $User->set('mailaddr', HTTP::POST('mailaddr') ?: NULL);
- $User->set('body', HTTP::POST('body') ?: NULL);
- $User->set('argv', HTTP::POST('argv') ?: NULL);
+ $User->set('username', HTTP::POST('username') ?: null);
+ $User->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : false);
+ $User->set('fullname', HTTP::POST('fullname') ?: null);
+ $User->set('mailaddr', HTTP::POST('mailaddr') ?: null);
+ $User->set('body', HTTP::POST('body') ?: null);
+ $User->set('argv', HTTP::POST('argv') ?: null);
$User->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$User->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/admin/user/update.php b/admin/user/update.php
index edd2bc1..cc24a23 100644
--- a/admin/user/update.php
+++ b/admin/user/update.php
@@ -2,8 +2,8 @@
#===============================================================================
# DEFINE: Administration
#===============================================================================
-const ADMINISTRATION = TRUE;
-const AUTHENTICATION = TRUE;
+const ADMINISTRATION = true;
+const AUTHENTICATION = true;
#===============================================================================
# INCLUDE: Initialization
@@ -27,12 +27,12 @@ if(!$User = $UserRepository->find(HTTP::GET('id'))) {
#===============================================================================
if(HTTP::issetPOST('update')) {
$User->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('username')));
- $User->set('username', HTTP::POST('username') ?: NULL);
- $User->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : FALSE);
- $User->set('fullname', HTTP::POST('fullname') ?: NULL);
- $User->set('mailaddr', HTTP::POST('mailaddr') ?: NULL);
- $User->set('body', HTTP::POST('body') ?: NULL);
- $User->set('argv', HTTP::POST('argv') ?: NULL);
+ $User->set('username', HTTP::POST('username') ?: null);
+ $User->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : false);
+ $User->set('fullname', HTTP::POST('fullname') ?: null);
+ $User->set('mailaddr', HTTP::POST('mailaddr') ?: null);
+ $User->set('body', HTTP::POST('body') ?: null);
+ $User->set('argv', HTTP::POST('argv') ?: null);
$User->set('time_insert', HTTP::POST('time_insert') ?: date('Y-m-d H:i:s'));
$User->set('time_update', HTTP::POST('time_update') ?: date('Y-m-d H:i:s'));
diff --git a/core/application.php b/core/application.php
index cb2e5b2..80ea1e7 100644
--- a/core/application.php
+++ b/core/application.php
@@ -42,14 +42,14 @@ set_exception_handler(function(Throwable $Exception) {
#===============================================================================
# Initialize HTTP class and remove all arrays from $_GET and $_POST
#===============================================================================
-HTTP::init($_GET, $_POST, $_FILES, TRUE);
+HTTP::init($_GET, $_POST, $_FILES, true);
#===============================================================================
# Set default configuration
#===============================================================================
foreach([
'CORE.LANGUAGE' => 'en',
- 'CORE.SEND_304' => FALSE,
+ 'CORE.SEND_304' => false,
'BLOGMETA.NAME' => 'Example blog',
'BLOGMETA.DESC' => 'This is an example blog.',
'BLOGMETA.HOME' => 'Home',
@@ -59,7 +59,7 @@ foreach([
'DATABASE.BASENAME' => 'blog',
'DATABASE.USERNAME' => 'blog',
'DATABASE.PASSWORD' => '',
- 'MIGRATOR.ENABLED' => TRUE,
+ 'MIGRATOR.ENABLED' => true,
'TEMPLATE.NAME' => 'default',
'TEMPLATE.LANG' => 'en',
'ADMIN.TEMPLATE' => 'admin',
@@ -67,15 +67,15 @@ foreach([
'PATHINFO.PROT' => $_SERVER['REQUEST_SCHEME'] ?? 'https',
'PATHINFO.HOST' => $_SERVER['HTTP_HOST'] ?? 'localhost',
'PATHINFO.BASE' => '',
- 'WRAP_EMOTICONS' => TRUE,
+ 'WRAP_EMOTICONS' => true,
'CATEGORY.DIRECTORY' => 'category',
'PAGE.DIRECTORY' => 'page',
'POST.DIRECTORY' => 'post',
'USER.DIRECTORY' => 'user',
- 'CATEGORY.SLUG_URLS' => TRUE,
- 'PAGE.SLUG_URLS' => TRUE,
- 'POST.SLUG_URLS' => TRUE,
- 'USER.SLUG_URLS' => TRUE,
+ 'CATEGORY.SLUG_URLS' => true,
+ 'PAGE.SLUG_URLS' => true,
+ 'POST.SLUG_URLS' => true,
+ 'USER.SLUG_URLS' => true,
'CATEGORY.LIST_SIZE' => 10,
'PAGE.LIST_SIZE' => 10,
'POST.LIST_SIZE' => 10,
@@ -85,10 +85,10 @@ foreach([
'PAGE.DESCRIPTION_SIZE' => 200,
'POST.DESCRIPTION_SIZE' => 200,
'USER.DESCRIPTION_SIZE' => 200,
- 'CATEGORY.REDIRECT_SINGLE' => FALSE,
- 'PAGE.REDIRECT_SINGLE' => FALSE,
- 'POST.REDIRECT_SINGLE' => FALSE,
- 'USER.REDIRECT_SINGLE' => FALSE,
+ 'CATEGORY.REDIRECT_SINGLE' => false,
+ 'PAGE.REDIRECT_SINGLE' => false,
+ 'POST.REDIRECT_SINGLE' => false,
+ 'USER.REDIRECT_SINGLE' => false,
'CATEGORY.LIST_SORT' => 'name ASC',
'PAGE.LIST_SORT' => 'time_insert DESC',
'POST.LIST_SORT' => 'time_insert DESC',
@@ -133,7 +133,7 @@ if(Application::get('MIGRATOR.ENABLED')) {
#===============================================================================
# Override configuration if admin
#===============================================================================
-if(defined('ADMINISTRATION') AND ADMINISTRATION === TRUE) {
+if(defined('ADMINISTRATION') and ADMINISTRATION === true) {
#===========================================================================
# Enable sessions
@@ -143,7 +143,7 @@ if(defined('ADMINISTRATION') AND ADMINISTRATION === TRUE) {
#===========================================================================
# Authentication check
#===========================================================================
- if(defined('AUTHENTICATION') AND !Application::isAuthenticated()) {
+ if(defined('AUTHENTICATION') and !Application::isAuthenticated()) {
HTTP::redirect(Application::getAdminURL('auth.php'));
}
@@ -164,7 +164,7 @@ $Database = Application::getDatabase();
#===============================================================================
# Check if "304 Not Modified" and ETag header should be sent
#===============================================================================
-if(Application::get('CORE.SEND_304') AND !defined('ADMINISTRATION')) {
+if(Application::get('CORE.SEND_304') and !defined('ADMINISTRATION')) {
#===========================================================================
# Fetch timestamps of the last modified entities
@@ -195,7 +195,7 @@ if(Application::get('CORE.SEND_304') AND !defined('ADMINISTRATION')) {
#===========================================================================
# Return "304 Not Modified" if the clients ETag value matches
#===========================================================================
- if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '', $etag) !== FALSE) {
- Application::exit(NULL, 304);
+ if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '', $etag) !== false) {
+ Application::exit(null, 304);
}
}
diff --git a/core/functions.php b/core/functions.php
index 15a5318..ffc1e1c 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -32,7 +32,7 @@ function createPaginationTemplate($current, $last, string $location): Template {
#===============================================================================
# Helper function to reduce duplicate code
#===============================================================================
-function generateCategoryItemTemplate(Category $Category, bool $is_root = FALSE): Template {
+function generateCategoryItemTemplate(Category $Category, bool $is_root = false): Template {
$CategoryRepository = Application::getRepository('Category');
foreach($CategoryRepository->findWithParents($Category->getID()) as $Category) {
@@ -121,8 +121,8 @@ function generateItemTemplateData(EntityInterface $Entity): array {
'ARGV' => $arguments,
'ATTR' => $attribute,
- 'PREV' => FALSE,
- 'NEXT' => FALSE,
+ 'PREV' => false,
+ 'NEXT' => false,
'FILE' => [
'LIST' => $images,
@@ -292,7 +292,7 @@ function generateSlug($string, $separator = '-') {
#===========================================================================
# Callback for (CATEGORY|PAGE|POST|USER) content function
#===========================================================================
-function getEntityMarkdownLink($ns, $id, $text = NULL, $info = NULL): string {
+function getEntityMarkdownLink($ns, $id, $text = null, $info = null): string {
if(!$Entity = Application::getRepository($ns)->find($id)) {
return sprintf('`{%s: *Reference error*}`', strtoupper($ns));
}
@@ -301,7 +301,7 @@ function getEntityMarkdownLink($ns, $id, $text = NULL, $info = NULL): string {
$href = Application::getEntityURL($Entity);
$text = $text ?: "»{$title}«";
- if($info === NULL) {
+ if($info === null) {
$info = sprintf('%s »%s«',
Application::getLanguage()->text(strtolower($ns)),
$title);
@@ -399,7 +399,7 @@ foreach(['CATEGORY', 'PAGE', 'POST', 'USER'] as $function) {
// Get Markdown formatted entity link
Application::addContentFunction($function,
- function($id, $text = NULL, $title = NULL) use($entity) {
+ function($id, $text = null, $title = null) use($entity) {
return getEntityMarkdownLink($entity, $id, $text, $title);
});
diff --git a/core/include/category/list.php b/core/include/category/list.php
index 62881a6..6894801 100644
--- a/core/include/category/list.php
+++ b/core/include/category/list.php
@@ -21,14 +21,14 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
#===============================================================================
# Single redirect
#===============================================================================
-if(Application::get('CATEGORY.REDIRECT_SINGLE') === TRUE AND $count === 1) {
+if(Application::get('CATEGORY.REDIRECT_SINGLE') === true and $count === 1) {
$Category = $CategoryRepository->getLast();
HTTP::redirect(Application::getEntityURL($Category));
}
@@ -42,7 +42,7 @@ $categories = $CategoryRepository->getPaginatedTree(
);
foreach($categories as $Category) {
- $templates[] = generateCategoryItemTemplate($Category, TRUE);
+ $templates[] = generateCategoryItemTemplate($Category, true);
}
#===============================================================================
diff --git a/core/include/category/main.php b/core/include/category/main.php
index 0fcece3..b1741b3 100644
--- a/core/include/category/main.php
+++ b/core/include/category/main.php
@@ -12,7 +12,7 @@ $UserRepository = Application::getRepository('User');
if(Application::get('CATEGORY.SLUG_URLS')) {
if(!$categories = $CategoryRepository->findWithParentsBy('slug', $param)) {
if($categories = $CategoryRepository->findWithParents($param)) {
- $redirect_scheduled = TRUE;
+ $redirect_scheduled = true;
}
}
}
@@ -20,7 +20,7 @@ if(Application::get('CATEGORY.SLUG_URLS')) {
else {
if(!$categories = $CategoryRepository->findWithParents($param)) {
if($categories = $CategoryRepository->findWithParentsBy('slug', $param)) {
- $redirect_scheduled = TRUE;
+ $redirect_scheduled = true;
}
}
}
@@ -80,7 +80,7 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
diff --git a/core/include/page/list.php b/core/include/page/list.php
index a02fd33..5fb4706 100644
--- a/core/include/page/list.php
+++ b/core/include/page/list.php
@@ -22,14 +22,14 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
#===============================================================================
# Single redirect
#===============================================================================
-if(Application::get('PAGE.REDIRECT_SINGLE') === TRUE AND $count === 1) {
+if(Application::get('PAGE.REDIRECT_SINGLE') === true and $count === 1) {
$Page = $PageRepository->getLast();
HTTP::redirect(Application::getEntityURL($Page));
}
diff --git a/core/include/post/list.php b/core/include/post/list.php
index c696419..8dfd183 100644
--- a/core/include/post/list.php
+++ b/core/include/post/list.php
@@ -22,14 +22,14 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
#===============================================================================
# Single redirect
#===============================================================================
-if(Application::get('POST.REDIRECT_SINGLE') === TRUE AND $count === 1) {
+if(Application::get('POST.REDIRECT_SINGLE') === true and $count === 1) {
$Post = $PostRepository->getLast();
HTTP::redirect(Application::getEntityURL($Post));
}
diff --git a/core/include/search/main.php b/core/include/search/main.php
index de7be9a..99d43ea 100644
--- a/core/include/search/main.php
+++ b/core/include/search/main.php
@@ -51,7 +51,7 @@ $form_data = [
$search_data = [
'TEXT' => $search,
- 'INFO' => isset($message) ? $message : FALSE,
+ 'INFO' => isset($message) ? $message : false,
];
#===============================================================================
diff --git a/core/include/user/list.php b/core/include/user/list.php
index ec8416d..e0b54a9 100644
--- a/core/include/user/list.php
+++ b/core/include/user/list.php
@@ -21,14 +21,14 @@ $lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
-if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
+if($currentSite < 1 or ($currentSite > $lastSite and $lastSite > 0)) {
Application::error404();
}
#===============================================================================
# Single redirect
#===============================================================================
-if(Application::get('USER.REDIRECT_SINGLE') === TRUE AND $count === 1) {
+if(Application::get('USER.REDIRECT_SINGLE') === true and $count === 1) {
$User = $UserRepository->getLast();
HTTP::redirect(Application::getEntityURL($User));
}
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 2d5a23c..3dee818 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -29,7 +29,7 @@ class Application {
# Get configuration value
#===============================================================================
public static function get($config) {
- return self::$configuration[$config] ?? NULL;
+ return self::$configuration[$config] ?? null;
}
#===============================================================================
@@ -42,8 +42,8 @@ class Application {
#===============================================================================
# Return singleton Database instance
#===============================================================================
- public static function getDatabase($force = FALSE): Database {
- if(!self::$Database instanceof Database OR $force === TRUE) {
+ public static function getDatabase($force = false): Database {
+ if(!self::$Database instanceof Database or $force === true) {
$hostname = self::get('DATABASE.HOSTNAME');
$basename = self::get('DATABASE.BASENAME');
$username = self::get('DATABASE.USERNAME');
@@ -70,8 +70,8 @@ class Application {
#===============================================================================
# Return singleton Language instance
#===============================================================================
- public static function getLanguage($force = FALSE): Language {
- if(!self::$Language instanceof Language OR $force === TRUE) {
+ public static function getLanguage($force = false): Language {
+ if(!self::$Language instanceof Language or $force === true) {
$template_name = self::get('TEMPLATE.NAME');
$template_lang = self::get('TEMPLATE.LANG');
@@ -237,7 +237,7 @@ class Application {
#===============================================================================
# Exit application with a custom message and status code
#===============================================================================
- public static function exit(?string $message = NULL, int $code = 503): void {
+ public static function exit(?string $message = null, int $code = 503): void {
http_response_code($code);
exit($message);
}
diff --git a/core/namespace/Factory.php b/core/namespace/Factory.php
index 779b890..e30895d 100644
--- a/core/namespace/Factory.php
+++ b/core/namespace/Factory.php
@@ -13,6 +13,6 @@ abstract class Factory implements FactoryInterface {
# Gets an instance of a class from the runtime instance cache
#===============================================================================
protected static function fetchInstance($identifier) {
- return self::$storage[get_called_class()][$identifier] ?? FALSE;
+ return self::$storage[get_called_class()][$identifier] ?? false;
}
}
diff --git a/core/namespace/HTTP.php b/core/namespace/HTTP.php
index 9145539..90efa44 100644
--- a/core/namespace/HTTP.php
+++ b/core/namespace/HTTP.php
@@ -1,8 +1,8 @@
<?php
class HTTP {
- private static $GET = NULL;
- private static $POST = NULL;
- private static $FILE = NULL;
+ private static $GET = null;
+ private static $POST = null;
+ private static $FILE = null;
#===============================================================================
# HTTP protocol versions
@@ -76,7 +76,7 @@ class HTTP {
#===============================================================================
# Initialize $GET, $POST and $FILE
#===============================================================================
- public static function init($GET, $POST, $FILE, $removeArrays = FALSE, $trimValues = TRUE) {
+ public static function init($GET, $POST, $FILE, $removeArrays = false, $trimValues = true) {
self::$GET = $GET;
self::$POST = $POST;
self::$FILE = $FILE;
@@ -86,8 +86,8 @@ class HTTP {
self::$POST = self::removeArrayValues(self::$POST);
}
- self::$GET = ($trimValues === TRUE ? self::trim(self::$GET) : self::$GET );
- self::$POST = ($trimValues === TRUE ? self::trim(self::$POST) : self::$POST);
+ self::$GET = ($trimValues === true ? self::trim(self::$GET) : self::$GET );
+ self::$POST = ($trimValues === true ? self::trim(self::$POST) : self::$POST);
}
#===============================================================================
@@ -116,38 +116,38 @@ class HTTP {
private static function issetData($data, $arguments): bool {
foreach($arguments as $key) {
if(is_array($key)) {
- if(!isset($data[key($key)]) OR $data[key($key)] !== $key[key($key)]) {
- return FALSE;
+ if(!isset($data[key($key)]) or $data[key($key)] !== $key[key($key)]) {
+ return false;
}
}
- else if(!isset($data[$key]) OR !is_string($data[$key])) {
- return FALSE;
+ else if(!isset($data[$key]) or !is_string($data[$key])) {
+ return false;
}
}
- return TRUE;
+ return true;
}
#===============================================================================
# Return GET value
#===============================================================================
public static function GET($parameter) {
- return self::$GET[$parameter] ?? NULL;
+ return self::$GET[$parameter] ?? null;
}
#===============================================================================
# Return POST value
#===============================================================================
public static function POST($parameter) {
- return self::$POST[$parameter] ?? NULL;
+ return self::$POST[$parameter] ?? null;
}
#===============================================================================
# Return FILE value
#===============================================================================
public static function FILE($parameter) {
- return self::$FILE[$parameter] ?? NULL;
+ return self::$FILE[$parameter] ?? null;
}
#===============================================================================
@@ -182,13 +182,13 @@ class HTTP {
# Get cookie
#===============================================================================
public static function getCookie($name) {
- return $_COOKIE[$name] ?? NULL;
+ return $_COOKIE[$name] ?? null;
}
#===============================================================================
# Return HTTP request method or check if request method equals with $method
#===============================================================================
- public static function requestMethod($method = NULL) {
+ public static function requestMethod($method = null) {
if(!empty($method)) {
return ($_SERVER['REQUEST_METHOD'] === $method);
}
@@ -200,7 +200,7 @@ class HTTP {
# Return REQUEST_URI
#===============================================================================
public static function requestURI() {
- return $_SERVER['REQUEST_URI'] ?? FALSE;
+ return $_SERVER['REQUEST_URI'] ?? false;
}
#===============================================================================
@@ -213,10 +213,10 @@ class HTTP {
#===============================================================================
# Sends a HTTP redirect to the client
#===============================================================================
- public static function redirect($location, $code = 303, $exit = TRUE) {
+ public static function redirect($location, $code = 303, $exit = true) {
http_response_code($code);
self::sendHeader("Location: {$location}");
- $exit AND exit();
+ $exit and exit();
}
#===============================================================================
diff --git a/core/namespace/Language.php b/core/namespace/Language.php
index a2facb0..804f3d5 100644
--- a/core/namespace/Language.php
+++ b/core/namespace/Language.php
@@ -18,7 +18,7 @@ class Language {
# Load another language file
#===============================================================================
public function load($filename) {
- if(file_exists($filename) AND is_readable($filename)) {
+ if(file_exists($filename) and is_readable($filename)) {
require $filename;
$this->text = array_merge($this->text, $LANGUAGE ?? []);
}
@@ -34,7 +34,7 @@ class Language {
#===============================================================================
# Return language string with included arguments
#===============================================================================
- public function text($name, $arguments = NULL): string {
+ public function text($name, $arguments = null): string {
if(!isset($this->text[$name])) {
return "{{$name}}";
}
diff --git a/core/namespace/Migrator.php b/core/namespace/Migrator.php
index 7b8d263..607c137 100644
--- a/core/namespace/Migrator.php
+++ b/core/namespace/Migrator.php
@@ -17,7 +17,7 @@ class Migrator {
$Statement = $Database->query('SELECT schema_version FROM migration');
# Explicitly check for FALSE, because result can be "0"
- if(($this->version = $Statement->fetchColumn()) === FALSE) {
+ if(($this->version = $Statement->fetchColumn()) === false) {
throw new Exception('The migration table does exist, but there is
no row containing the currently used on-disk schema version!');
}
diff --git a/core/namespace/ORM/Entity.php b/core/namespace/ORM/Entity.php
index 61b9371..5462b54 100644
--- a/core/namespace/ORM/Entity.php
+++ b/core/namespace/ORM/Entity.php
@@ -13,7 +13,7 @@ abstract class Entity implements EntityInterface {
# Get attribute
#===============================================================================
public function get(string $attribute) {
- return $this->{$attribute} ?? NULL;
+ return $this->{$attribute} ?? null;
}
#===============================================================================
diff --git a/core/namespace/ORM/Repositories/CategoryRepository.php b/core/namespace/ORM/Repositories/CategoryRepository.php
index 7c7b3f9..657940c 100644
--- a/core/namespace/ORM/Repositories/CategoryRepository.php
+++ b/core/namespace/ORM/Repositories/CategoryRepository.php
@@ -47,7 +47,7 @@ class CategoryRepository extends Repository {
# element. PHP >= 8 will throw a PDOException when the number of
# bound variables doesn't matches the number of tokens ("?") in
# the SQL query, which is the case here if $value is NULL.
- is_null($value) ? NULL : [$value]
+ is_null($value) ? null : [$value]
);
# TODO: Virtual column _depth shall not be fetched into the entity class
@@ -128,7 +128,7 @@ class CategoryRepository extends Repository {
$UpdateStatement = $this->Database->prepare($query);
$UpdateStatement->execute([$_parent, $Entity->get('parent')]);
break;
- } else if($_parent === NULL) {
+ } else if($_parent === null) {
break;
}
}
diff --git a/core/namespace/ORM/Repository.php b/core/namespace/ORM/Repository.php
index e7750cb..ca3690f 100644
--- a/core/namespace/ORM/Repository.php
+++ b/core/namespace/ORM/Repository.php
@@ -23,7 +23,7 @@ abstract class Repository {
return $Entity;
}
- return NULL;
+ return null;
}
#===============================================================================
@@ -60,7 +60,7 @@ abstract class Repository {
# Gets an entity from the runtime cache
#===============================================================================
protected function fetchInstance($identifier) {
- return $this->entities[$identifier] ?? FALSE;
+ return $this->entities[$identifier] ?? false;
}
#===============================================================================
@@ -93,7 +93,7 @@ abstract class Repository {
return $Statement->execute($params);
}
- return FALSE;
+ return false;
}
#===========================================================================
@@ -115,7 +115,7 @@ abstract class Repository {
return $Statement->execute($params);
}
- return FALSE;
+ return false;
}
#===========================================================================
@@ -199,7 +199,7 @@ abstract class Repository {
if(!empty($filter)) {
foreach($filter as $column => $value) {
- if($value === NULL) {
+ if($value === null) {
$wheres[] = "$column IS NULL";
} else {
$wheres[] = "$column = ?";
diff --git a/core/namespace/ORM/RepositorySearch.php b/core/namespace/ORM/RepositorySearch.php
index aac46ef..66f27ea 100644
--- a/core/namespace/ORM/RepositorySearch.php
+++ b/core/namespace/ORM/RepositorySearch.php
@@ -8,7 +8,7 @@ trait RepositorySearch {
#===============================================================================
# Get entities based on search query
#===============================================================================
- public function search(string $search, array $filter = [], int $limit = NULL, int $offset = 0): array {
+ public function search(string $search, array $filter = [], int $limit = null, int $offset = 0): array {
if(strlen($filter['year'] ?? '') !== 0) {
$extend[] = 'YEAR(time_insert) = ? AND';
$params[] = $filter['year'];
@@ -24,12 +24,12 @@ trait RepositorySearch {
$params[] = $filter['day'];
}
- if(is_numeric($filter['user'] ?? NULL)) {
+ if(is_numeric($filter['user'] ?? null)) {
$extend[] = 'user = ? AND';
$params[] = $filter['user'];
}
- if(is_numeric($filter['category'] ?? NULL)) {
+ if(is_numeric($filter['category'] ?? null)) {
$extend[] = 'category = ? AND';
$params[] = $filter['category'];
}
diff --git a/core/namespace/Parsers/ArgumentParser.php b/core/namespace/Parsers/ArgumentParser.php
index ab32fe1..4ac3b9c 100644
--- a/core/namespace/Parsers/ArgumentParser.php
+++ b/core/namespace/Parsers/ArgumentParser.php
@@ -10,8 +10,8 @@ class ArgumentParser implements ParserInterface {
foreach(explode('|', $text) as $delimiter) {
$part = explode('=', $delimiter);
- $argumentK = $part[0] ?? NULL;
- $argumentV = $part[1] ?? TRUE;
+ $argumentK = $part[0] ?? null;
+ $argumentV = $part[1] ?? true;
if(preg_match('#^[[:word:]]+$#', $argumentK)) {
$arguments[strtoupper($argumentK)] = $argumentV;
diff --git a/core/namespace/Parsers/MarkdownParser.php b/core/namespace/Parsers/MarkdownParser.php
index 27a18ad..b9ebc15 100644
--- a/core/namespace/Parsers/MarkdownParser.php
+++ b/core/namespace/Parsers/MarkdownParser.php
@@ -10,7 +10,7 @@ class MarkdownParser implements ParserInterface {
#===========================================================================
public function __construct() {
$this->Parsedown = new Parsedown();
- $this->Parsedown->setUrlsLinked(FALSE);
+ $this->Parsedown->setUrlsLinked(false);
}
#===========================================================================
diff --git a/core/namespace/Router.php b/core/namespace/Router.php
index 803a8e0..ffb3154 100644
--- a/core/namespace/Router.php
+++ b/core/namespace/Router.php
@@ -34,7 +34,7 @@ class Router {
#===============================================================================
public static function execute($path) {
$path = ltrim($path, '/');
- $route_found = FALSE;
+ $route_found = false;
foreach(self::$routes as $route) {
if($route['type'] === 'redirect') {
@@ -50,13 +50,13 @@ class Router {
# Remove the first element from matches which contains the whole string.
array_shift($matches);
- $route_found = TRUE;
+ $route_found = true;
call_user_func_array($route['callback'], $matches);
}
}
}
- if($route_found === FALSE) {
+ if($route_found === false) {
Application::error404();
}
}
diff --git a/core/namespace/Template/Template.php b/core/namespace/Template/Template.php
index 25034a2..4967a7f 100644
--- a/core/namespace/Template/Template.php
+++ b/core/namespace/Template/Template.php
@@ -27,7 +27,7 @@ class Template {
# Get parameter
#===============================================================================
public function get($name) {
- return $this->parameters[$name] ?? NULL;
+ return $this->parameters[$name] ?? null;
}
#===============================================================================
diff --git a/core/script/convert_content_tags.php b/core/script/convert_content_tags.php
index 7b879a3..e11e820 100644
--- a/core/script/convert_content_tags.php
+++ b/core/script/convert_content_tags.php
@@ -42,7 +42,7 @@ function convertContentTags(string $text, &$globalMatches): string {
str_replace('"', '\\"', $matches['text'])
];
- if($linkTitle = $matches['title'] ?? FALSE) {
+ if($linkTitle = $matches['title'] ?? false) {
$q = $matches['qmark'];
$format = '{%s: %d, "%s", '.$q.'%s'.$q.'}';
$params[] = $linkTitle;
@@ -95,10 +95,10 @@ HTTP::responseHeader(HTTP::HEADER_CONTENT_TYPE, HTTP::CONTENT_TYPE_TEXT);
#===========================================================================
# Set "commit" variable based on GET parameter or CLI argument
#===========================================================================
-$commit = FALSE;
+$commit = false;
if(isset($_GET['commit']) OR
- (isset($argv[1]) AND $argv[1] === 'commit')) {
- $commit = TRUE;
+ (isset($argv[1]) and $argv[1] === 'commit')) {
+ $commit = true;
}
#===========================================================================
@@ -121,7 +121,7 @@ foreach(['Category', 'Page', 'Post', 'User'] as $entityName) {
$content = convertContentTags($content, $matches);
if($matches) {
- $foundMatches = TRUE;
+ $foundMatches = true;
if($commit) {
$Entity->set('body', $content);
diff --git a/theme/admin/html/category/form.php b/theme/admin/html/category/form.php
index 46f056e..5bdee9c 100644
--- a/theme/admin/html/category/form.php
+++ b/theme/admin/html/category/form.php
@@ -1,5 +1,5 @@
<?php
-function categorySelectList($category_tree, $selected = NULL, $current = NULL, $prefix = '') {
+function categorySelectList($category_tree, $selected = null, $current = null, $prefix = '') {
foreach($category_tree as $category) {
$option = '<option value="%s"%s>%s%s [%d]</option>';
$select = ($category['ID'] == $selected) ? ' selected' : '';
diff --git a/theme/admin/html/main.php b/theme/admin/html/main.php
index c6fe12c..bf6bd1a 100644
--- a/theme/admin/html/main.php
+++ b/theme/admin/html/main.php
@@ -3,11 +3,11 @@ if($toogle = HTTP::GET('colors')) {
$options = ['path' => '/', 'samesite' => 'Lax'];
if($toogle === 'dark') {
- $_COOKIE['dark_mode'] = TRUE;
- setcookie('dark_mode', TRUE, $options);
+ $_COOKIE['dark_mode'] = true;
+ setcookie('dark_mode', true, $options);
} else {
unset($_COOKIE['dark_mode']);
- setcookie('dark_mode', NULL, array_merge($options, ['expires' => -1]));
+ setcookie('dark_mode', null, array_merge($options, ['expires' => -1]));
}
}
diff --git a/theme/admin/html/post/form.php b/theme/admin/html/post/form.php
index 8ad514a..452728d 100644
--- a/theme/admin/html/post/form.php
+++ b/theme/admin/html/post/form.php
@@ -1,5 +1,5 @@
<?php
-function categorySelectList($category_tree, $selected = NULL, $prefix = '') {
+function categorySelectList($category_tree, $selected = null, $prefix = '') {
foreach($category_tree as $category) {
$option = '<option value="%s"%s>%s%s [%d]</option>';
$select = ($category['ID'] == $selected) ? ' selected' : '';
diff --git a/theme/admin/html/post/search.php b/theme/admin/html/post/search.php
index 0a0d959..695db62 100644
--- a/theme/admin/html/post/search.php
+++ b/theme/admin/html/post/search.php
@@ -1,5 +1,5 @@
<?php
-function categorySelectList($category_tree, $selected = NULL, $prefix = '') {
+function categorySelectList($category_tree, $selected = null, $prefix = '') {
foreach($category_tree as $category) {
$option = '<option value="%s"%s>%s%s [%d]</option>';
$select = ($category['ID'] == $selected) ? ' selected' : '';
diff --git a/theme/default/html/main.php b/theme/default/html/main.php
index 223464c..c3f0f86 100644
--- a/theme/default/html/main.php
+++ b/theme/default/html/main.php
@@ -10,8 +10,8 @@
#===============================================================================
# Escape parameters which are used several times here to reduce escapeHTML calls
#===============================================================================
-$HEAD_NAME = isset($HEAD['NAME']) ? escapeHTML($HEAD['NAME']) : NULL;
-$HEAD_DESC = isset($HEAD['DESC']) ? escapeHTML($HEAD['DESC']) : NULL;
+$HEAD_NAME = isset($HEAD['NAME']) ? escapeHTML($HEAD['NAME']) : null;
+$HEAD_DESC = isset($HEAD['DESC']) ? escapeHTML($HEAD['DESC']) : null;
$BLOGMETA_NAME = escapeHTML($BLOGMETA['NAME']);
$BLOGMETA_DESC = escapeHTML($BLOGMETA['DESC']);
?>