diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 0ee5c3530..cbd7e1fc3 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -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[] = "".$start.$val.$end.""; } } diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index 55f6c9ed2..91511dc34 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -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') {