FIX: strip emoji string from slug

This commit is contained in:
Arpit Jalan
2018-04-18 00:14:43 +05:30
parent ec7448bd1b
commit 3566c6f02b
2 changed files with 6 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ module Slug
MAX_LENGTH = 255
def self.for(string, default = 'topic', max_length = MAX_LENGTH)
string = string.gsub(/:([\w\-+]+(?::t\d)?):/, '') if string.present? # strip emoji strings
slug =
case (SiteSetting.slug_generation_method || :ascii).to_sym
when :ascii then self.ascii_generator(string)