Skip to content

Commit

Permalink
Add support for data:text/tml urls
Browse files Browse the repository at this point in the history
Added Support for inline iframe content. This allows urls of type "data:text/html" to be specified in the URL field. The HTML of the iframe then follows in either URL-encoded format or base64 econded format.

For example, the url specified as 
```
   data:text/html;charset=utf-8;base64, PGh0bWw+PGJvZHk+SGVsbG8gV29ybGQ8L2JvZHk+PC9odG1sPg==
```
Will add an iframe with the "hello world" text in it.
  • Loading branch information
garci66 authored Mar 20, 2017
1 parent 87a96a6 commit 168b7fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/iframe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.form_attributes
end

def url_must_exist
if config['url'].empty? || (config['url'] =~ /[a-z]+\:\/\/.+/).nil?
if config['url'].empty? || (config['url'] =~ /[a-z]+\:\/\/.+/).nil? && !config['url'].starts_with?("data:text/html")
errors.add(:url, 'an absolute Url must be specified')
end
end
Expand Down

0 comments on commit 168b7fc

Please # to comment.