From 3037af3a80246870284e7c1ab52f407a081f5ffd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 24 Jul 2021 21:53:10 +0200 Subject: Create feed item's GUID manually in template file Do not rely on the "$POST['GUID']" template parameter anymore and create the GUID for the feed item manually in the feed item's template file. The application internal function "generatePseudoGUID" has been removed and the function "generateItemTemplateData" will not return the "GUID" part anymore (which was only used by the feed item template anyway). For backward compatibility, the "$POST['GUID']" template parameter will still be present in the feed item template, but not in other templates! --- core/include/feed/main.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/include/feed/main.php') diff --git a/core/include/feed/main.php b/core/include/feed/main.php index cbabb2c..9f1e4d4 100644 --- a/core/include/feed/main.php +++ b/core/include/feed/main.php @@ -31,7 +31,10 @@ foreach($posts as $Post) { $ItemTemplate = Template\Factory::build('feed/item_post'); } - $ItemTemplate->set('POST', generateItemTemplateData($Post)); + $post_data = generateItemTemplateData($Post); + $post_data['GUID'] = sha1($Post->getID().$Post->get('time_insert')); + + $ItemTemplate->set('POST', $post_data); $ItemTemplate->set('USER', generateItemTemplateData($User)); $templates[] = $ItemTemplate; -- cgit v1.2.3