From 168b7fcfc25f68fe75c02222c3968888d1361013 Mon Sep 17 00:00:00 2001 From: Diego Garcia del Rio Date: Mon, 20 Mar 2017 18:13:31 -0300 Subject: [PATCH] Add support for data:text/tml urls 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. --- app/models/iframe.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/iframe.rb b/app/models/iframe.rb index 07ceac1..c61c473 100644 --- a/app/models/iframe.rb +++ b/app/models/iframe.rb @@ -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