From: Evan Prodromou Date: Tue, 2 Aug 2011 17:49:00 +0000 (-0400) Subject: cleanse tags of non-tag characters when canonicalizing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=10ce44c2971f65c5fa732d91a74e3fa61d43c3bd;p=quix0rs-gnu-social.git cleanse tags of non-tag characters when canonicalizing --- diff --git a/lib/util.php b/lib/util.php index e5b0c86e06..d8eee3d134 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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)