1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Fix for news tag links containing spaces.

This commit is contained in:
Cameron 2021-09-25 10:25:04 -07:00
parent af0b5dcb84
commit 5cf3f9d57b
2 changed files with 5 additions and 2 deletions

View File

@ -1155,7 +1155,7 @@ class news_shortcodes extends e_shortcode
{
//$url = e107::getUrl()->create('news/list/tag',array('tag'=>rawurlencode($val))); // e_BASE."news.php?tag=".$val
// will be encoded during create()
$url = e107::getUrl()->create('news/list/tag',array('tag'=>$val)); // e_BASE."news.php?tag=".$val
$url = e107::getUrl()->create('news/list/tag',array('tag'=> str_replace(' ','-',$val))); // e_BASE."news.php?tag=".$val
$words[] = "<a class='".$class."' href='".$url."'>".$start.$val.$end."</a>";
}
}

View File

@ -933,6 +933,7 @@ class news_front
elseif($this->action === 'tag')
{
$tagsearch = e107::getParser()->filter($_GET['tag']);
$tagsearch2 = str_replace('-', ' ',$tagsearch);
$query = "
SELECT SQL_CALC_FOUND_ROWS n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords,
@ -940,15 +941,17 @@ class news_front
FROM #news AS n
LEFT JOIN #user AS u ON n.news_author = u.user_id
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
WHERE n.news_meta_keywords LIKE '%".$tagsearch."%'
WHERE n.news_meta_keywords LIKE '%".$tagsearch."%' OR n.news_meta_keywords LIKE '%".$tagsearch2."%'
AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")
AND n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$this->nobody_regexp.")
ORDER BY n.news_datestamp DESC
LIMIT ".intval($this->from).",".NEWSLIST_LIMIT;
$category_name = defset('LAN_NEWS_309','Tag').': "'.$tagsearch.'"';
$tagsearch = $tagsearch2;
$this->tagAuthor = $tagsearch;
}
elseif($this->action === 'author')
{