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
committed by tms
parent ea9196a8a2
commit a7a2dcebac
9 changed files with 79 additions and 79 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