Commit 10ce44c2 authored by Evan Prodromou's avatar Evan Prodromou

cleanse tags of non-tag characters when canonicalizing

parent e0238e7c
......@@ -1096,8 +1096,11 @@ function common_tag_link($tag)
function common_canonical_tag($tag)
{
// only alphanum
$tag = preg_replace('/[^\pL\pN]/', '', $tag);
$tag = mb_convert_case($tag, MB_CASE_LOWER, "UTF-8");
return str_replace(array('-', '_', '.'), '', $tag);
$tag = substr($tag, 0, 64);
return $tag;
}
function common_valid_profile_tag($str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment