From 434c48cff635317e51286e9bf2f1681feb48bf4b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 24 Jul 2021 21:41:41 +0200 Subject: Remove configuration option "POST.FEED_GUID" Remove the configuration option "POST.FEED_GUID" that contained the name of the columns from the database which were passed to the SHA1 function for generating the pseudo GUID for the items in the RSS feed. --- core/application.php | 3 +-- core/functions.php | 17 ++++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/core/application.php b/core/application.php index 0c73f54..2f6a277 100644 --- a/core/application.php +++ b/core/application.php @@ -89,8 +89,7 @@ foreach([ 'PAGE.LIST_SORT' => 'time_insert DESC', 'POST.LIST_SORT' => 'time_insert DESC', 'USER.LIST_SORT' => 'time_insert DESC', - 'POST.FEED_SORT' => 'time_insert DESC', - 'POST.FEED_GUID' => ['id', 'time_insert'] + 'POST.FEED_SORT' => 'time_insert DESC' ] as $name => $value) { Application::set($name, $value); } diff --git a/core/functions.php b/core/functions.php index d5b56a2..538849b 100644 --- a/core/functions.php +++ b/core/functions.php @@ -155,19 +155,10 @@ function generateCategoryDataTree(array $category_data, $root = 0): array { # Generate pseudo GUID for entity #=============================================================================== function generatePseudoGUID(EntityInterface $Entity) { - switch(get_class($Entity)) { - case "ORM\Entities\Post": - $attr = Application::get('POST.FEED_GUID'); - break; - default: - $attr = ['id', 'time_insert']; - } - - foreach($attr as $attribute) { - $attributes[] = $Entity->get($attribute); - } - - return sha1(implode('', $attributes)); + return sha1(implode('', [ + $Entity->getID(), + $Entity->get('time_insert') + ])); } #=============================================================================== -- cgit v1.2.3