allwow https youtube links

This commit is contained in:
MrZYX 2011-03-19 22:19:31 +01:00
parent 25aadebf46
commit 7cd1789669

View file

@ -212,7 +212,7 @@ module ApplicationHelper
end
def process_youtube(message, youtube_maps)
regex = /( |^)(http:\/\/)?www\.youtube\.com\/watch[^ ]*v=([A-Za-z0-9_\-]+)(&[^ ]*|)/
regex = /( |^)(https?:\/\/)?www\.youtube\.com\/watch[^ ]*v=([A-Za-z0-9_\-]+)(&[^ ]*|)/
processed_message = message.gsub(regex) do |matched_string|
match_data = matched_string.match(regex)
video_id = match_data[3]