2014-06-27, 07:18:19
Another bug you can find is the duplicate tags cause CASE SENSITIVE.
You could have some post with the tags: "Hello", "hello", "HELLO", etc. and this tags are treated as DIFFERENT ONES.
This can be solved modifing the frontEndFunctions.php like that:
And adding
on show_blog_post function before printing tags.
This will lowercase all tags, and "Hello", "hello", "HELLO", etc. will work as same.
You could have some post with the tags: "Hello", "hello", "HELLO", etc. and this tags are treated as DIFFERENT ONES.
This can be solved modifing the frontEndFunctions.php like that:
PHP Code:
/**
* Show posts for requested tag
*
* @return void
*/
function show_blog_tag($tag)
{
$Blog = new Blog;
$all_posts = $Blog->listPosts(true, true);
$tagtext = i18n_r(BLOGFILE.'/TAGTEXT');
echo '<h4>'.$tagtext.' '.$tag.'</h4>';
foreach ($all_posts as $file)
{
$data = getXML($file['filename']);
if(!empty($data->tags))
{
$tag = strtolower($tag);
$tags = explode(',', $data->tags);
$tags = array_map('strtolower', $tags);
if (in_array($tag, $tags))
{
show_blog_post($file['filename'], true);
}
}
}
}
And adding
PHP Code:
$tags = array_map('strtolower', $tags);
on show_blog_post function before printing tags.
This will lowercase all tags, and "Hello", "hello", "HELLO", etc. will work as same.