diff options
author | Thomas Lange <code@nerdmind.de> | 2021-07-24 21:41:41 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-07-24 21:44:26 +0200 |
commit | 434c48cff635317e51286e9bf2f1681feb48bf4b (patch) | |
tree | 70e5453daf5fadc3e76d7a007a8b41c8a80d53d0 /core | |
parent | a7b982bf620f19804d2f762d769e1de820bad252 (diff) | |
download | blog-434c48cff635317e51286e9bf2f1681feb48bf4b.tar.gz blog-434c48cff635317e51286e9bf2f1681feb48bf4b.tar.xz blog-434c48cff635317e51286e9bf2f1681feb48bf4b.zip |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/application.php | 3 | ||||
-rw-r--r-- | 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') + ])); } #=============================================================================== |