Commit 3b5767b14ed8dbabc98ca1af30d324397f129fc4

Authored by Joenio Costa
1 parent a0776e2f

simplifying regex pattern

'\w-' is the same of 'a-zA-Z0-9_-'

(ActionItem3122)
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
plugins/video/lib/video_block.rb
... ... @@ -4,7 +4,7 @@ class VideoBlock < Block
4 4 settings_items :width, :type => :integer, :default => 400
5 5 settings_items :height, :type => :integer, :default => 315
6 6  
7   - YOUTUBE_ID_FORMAT = 'a-zA-Z0-9_-'
  7 + YOUTUBE_ID_FORMAT = '\w-'
8 8  
9 9 def is_youtube?
10 10 url.match(/.*(youtube.com.*v=[#{YOUTUBE_ID_FORMAT}]+|youtu.be\/[#{YOUTUBE_ID_FORMAT}]+).*/) ? true : false
... ...