#82: updated regexp

This commit is contained in:
Vokhmin Alexey V 2013-07-08 18:15:54 +04:00
parent ecfde4ad21
commit 9eaf62666b
1 changed files with 2 additions and 2 deletions

View File

@ -66,9 +66,9 @@ class PlatformContent
# ---------------------
def self.find_by_platform(platform, path, term)
term = (term.present? && term =~ /\w/) ? term : ''
term = (term.present? && term =~ /^[\w]+$/) ? term : ''
path = path.split(File::SEPARATOR)
.select{ |p| p.present? && p =~ /\w/ }
.select{ |p| p.present? && p =~ /^[\w]+$/ }
.join(File::SEPARATOR)
results = Dir.glob(File.join(platform.path, path, "*#{term}*"))
if term