Skip to content

Commit

Permalink
Fixed Title issue for Related Articles
Browse files Browse the repository at this point in the history
Fix for #1048
  • Loading branch information
eSilverStrike committed Mar 25, 2020
1 parent 2dc3484 commit 137b1c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions system/classes/article.class.php
Expand Up @@ -2025,15 +2025,15 @@ private static function getRelatedArticlesSort(array $a, array $b)
* @return array
* @link http://www.enkeladress.com/article/20110315104621317
*/
public static function getRelatedArticlesByKeywords($articleId, $keywordList, $limit = 5)
public function getRelatedArticlesByKeywords($articleId, $keywordList, $limit = 5)
{
global $_CONF, $LANG24, $_TABLES;

$work = array();

// Lets search the 50 latest articles that match the keyword
// This will return the most related
$searchlimit = 50;
$searchlimit = 50;

$articleId = trim($articleId);
$keywords = explode(',', $keywordList);
Expand Down Expand Up @@ -2065,7 +2065,7 @@ public static function getRelatedArticlesByKeywords($articleId, $keywordList, $l

while (($A = DB_fetchArray($resultSet, false)) !== false) {
$sid = $A['sid'];
$title = stripslashes($A['title']);
$title = $A['title'];
$found = false;

foreach ($work as &$item) {
Expand Down Expand Up @@ -2103,7 +2103,7 @@ public static function getRelatedArticlesByKeywords($articleId, $keywordList, $l
foreach ($work as $item) {
$retval[] = '<li>'
. '<a href="' . COM_buildURL($_CONF['site_url'] . '/article.php?story=' . $item['sid'])
. '">' . htmlspecialchars($item['title'], ENT_QUOTES, $encoding) . '</a>'
. '">' . $this->_displayEscape($item['title']). '</a>'
. '</li>' . PHP_EOL;
}

Expand Down
2 changes: 1 addition & 1 deletion system/lib-article.php
Expand Up @@ -658,7 +658,7 @@ function STORY_renderArticle($story, $index = '', $storyTpl = 'articletext.thtml
if ($index === 'n' && $_CONF['meta_tags'] > 0) {
$article->set_var(
'related_articles_by_keyword',
Article::getRelatedArticlesByKeywords(
$story->getRelatedArticlesByKeywords(
$story->getSid(),
$story->DisplayElements('meta_keywords')
)
Expand Down

0 comments on commit 137b1c0

Please sign in to comment.