From 3e629a13415391e70e4e915f7706f3828912da20 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 7 Jul 2017 22:30:05 +0200 Subject: The function "makeSlugURL" has been renamed to "generateSlug" because the name was misleading because the function did not generate a complete URL, but only a partial string (the slug) for the final URL. By the way, some improvements were made to the code. --- core/include/feed/main.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/include/feed/main.php') diff --git a/core/include/feed/main.php b/core/include/feed/main.php index 8879e72..b8e03dc 100644 --- a/core/include/feed/main.php +++ b/core/include/feed/main.php @@ -15,7 +15,10 @@ HTTP::responseHeader(HTTP::HEADER_CONTENT_TYPE, HTTP::CONTENT_TYPE_XML); #=============================================================================== try { if(!isset($param) OR $param !== 'page') { - $execSQL = 'SELECT id FROM %s ORDER BY '.Application::get('POST.FEED_SORT').' LIMIT '.Application::get('POST.FEED_SIZE'); + $POST['FEED_SORT'] = Application::get('POST.FEED_SORT'); + $POST['FEED_SIZE'] = Application::get('POST.FEED_SIZE'); + + $execSQL = "SELECT id FROM %s ORDER BY {$POST['FEED_SORT']} LIMIT {$POST['FEED_SIZE']}"; $postIDs = $Database->query(sprintf($execSQL, Post\Attribute::TABLE))->fetchAll($Database::FETCH_COLUMN); foreach($postIDs as $postID) { @@ -36,7 +39,10 @@ try { } if(!isset($param) OR $param !== 'post') { - $execSQL = 'SELECT id FROM %s ORDER BY '.Application::get('PAGE.FEED_SORT').' LIMIT '.Application::get('PAGE.FEED_SIZE'); + $PAGE['FEED_SORT'] = Application::get('PAGE.FEED_SORT'); + $PAGE['FEED_SIZE'] = Application::get('PAGE.FEED_SIZE'); + + $execSQL = "SELECT id FROM %s ORDER BY {$PAGE['FEED_SORT']} LIMIT {$PAGE['FEED_SIZE']}"; $pageIDs = $Database->query(sprintf($execSQL, Page\Attribute::TABLE))->fetchAll($Database::FETCH_COLUMN); foreach($pageIDs as $pageID) { -- cgit v1.2.3