Ruby 这段 Typo 的代码没有看懂

cxh116 · February 14, 2012 · 2205 hits

vendor/plugins/typo_login_system/lib/access_control.rb

def uid @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '') end

非 a-z0-9 的字符都已经替换掉了,为什么还需要 gsub(/-+$/, '').gsub(/^-+$/, '')

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.