aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/application.php5
-rw-r--r--core/functions.php20
2 files changed, 2 insertions, 23 deletions
diff --git a/core/application.php b/core/application.php
index 7ddf6a0..f44bb27 100644
--- a/core/application.php
+++ b/core/application.php
@@ -63,6 +63,7 @@ foreach([
'PATHINFO.PROT' => $_SERVER['REQUEST_SCHEME'] ?? 'https',
'PATHINFO.HOST' => $_SERVER['HTTP_HOST'] ?? 'localhost',
'PATHINFO.BASE' => '',
+ 'WRAP_EMOTICONS' => TRUE,
'CATEGORY.DIRECTORY' => 'category',
'PAGE.DIRECTORY' => 'page',
'POST.DIRECTORY' => 'post',
@@ -71,10 +72,6 @@ foreach([
'PAGE.SLUG_URLS' => TRUE,
'POST.SLUG_URLS' => TRUE,
'USER.SLUG_URLS' => TRUE,
- 'CATEGORY.EMOTICONS' => TRUE,
- 'PAGE.EMOTICONS' => TRUE,
- 'POST.EMOTICONS' => TRUE,
- 'USER.EMOTICONS' => TRUE,
'CATEGORY.LIST_SIZE' => 10,
'PAGE.LIST_SIZE' => 10,
'POST.LIST_SIZE' => 10,
diff --git a/core/functions.php b/core/functions.php
index b622601..ff52e0c 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -188,30 +188,12 @@ function parseContentTags(string $text): string {
# Parse entity content
#===============================================================================
function parseEntityContent(EntityInterface $Entity): string {
- switch($class = get_class($Entity)) {
- case 'ORM\Entities\Category':
- $prefix = 'CATEGORY';
- break;
- case 'ORM\Entities\Page':
- $prefix = 'PAGE';
- break;
- case 'ORM\Entities\Post':
- $prefix = 'POST';
- break;
- case 'ORM\Entities\User':
- $prefix = 'USER';
- break;
- default:
- $error = 'Unknown config prefix for <code>%s</code> entities.';
- throw new Exception(sprintf($error, $class));
- }
-
$Parsedown = new Parsedown();
$Parsedown->setUrlsLinked(FALSE);
$text = parseContentTags($Entity->get('body'));
- if(Application::get("$prefix.EMOTICONS")) {
+ if(Application::get('WRAP_EMOTICONS')) {
$text = parseUnicodeEmoticons($text);
}