1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Fixes #4820 - Removed possibility of broken tag links.

This commit is contained in:
Cameron
2022-07-14 10:22:59 -07:00
parent 31d7002ff2
commit 4104162179
2 changed files with 5 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ class tagcloud_menu
{
$fields = array();
$fields['tagcloud_caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
$fields['order'] = array('title'=> LAN_ORDER, 'type'=>'dropdown', 'writeParms'=>['optArray'=>['tag,asc'=>'Tag ASC', 'tag,desc'=>'Tag DESC', 'size,asc'=>'Size ASC','size,desc'=>'Size DESC']]);
$fields['tagcloud_limit'] = array('title'=> LAN_LIMIT, 'type'=>'number');
return $fields;

View File

@@ -79,15 +79,16 @@ if(!class_exists('tagcloud_menu'))
foreach ($tmp as $word)
{
if($c >= $words)
$word = trim($word);
if(empty($word) || ($c >= $words))
{
continue;
}
//$newsUrlparms = array('id'=> $row['news_id'], 'name'=>'a name');
$url = e107::getUrl()->create('news/list/tag', array('tag' => $word)); // SITEURL."news.php?tag=".$word;
$url = e107::getUrl()->create('news/list/tag', array('tag' => str_replace(' ','-',$word))); // SITEURL."news.php?tag=".$word;
$cloud->addTag(array('tag' => $word, 'url' => $url));
$c++;
$wordCount++;