Include /^http… prefix in onebox whitelist URLs regexes to prevent XSS.

This commit is contained in:
Jeremy Banks
2013-02-19 01:49:58 -05:00
parent d520771c73
commit 91f9844211
9 changed files with 78 additions and 78 deletions

View File

@ -3,7 +3,7 @@ require_dependency 'oneboxer/handlebars_onebox'
module Oneboxer
class GithubBlobOnebox < HandlebarsOnebox
matcher /github\.com\/[^\/]+\/[^\/]+\/blob\/.*/
matcher /^https?:\/\/(?:www\.)?github\.com\/[^\/]+\/[^\/]+\/blob\/.*/
favicon 'github.png'
def translate_url