From 3b3a07d3331816abf8e8dfc3ff8fdbc11eeed10f Mon Sep 17 00:00:00 2001 From: Robbie Mackay Date: Wed, 24 Apr 2013 10:26:19 +1200 Subject: [PATCH] Set default values for allowed html and iframesi #1056 This avoids errors if upgraders don't update config.php Conflicts: application/i18n --- application/hooks/2_settings.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/hooks/2_settings.php b/application/hooks/2_settings.php index 1a680f59e2..4c49a54b0b 100644 --- a/application/hooks/2_settings.php +++ b/application/hooks/2_settings.php @@ -76,3 +76,15 @@ { Kohana::config_set('config.external_site_protocol', 'https'); } + +// Default for allowed_html in case upgraders don't add it to config.php +if ( ! Kohana::config('config.allowed_html') ) +{ + Kohana::config_set('config.allowed_html', 'a[href|title],p,img[src|alt],br,b,u,strong,em,i'); +} +// Default for allowed iframe regexp, in case upgraders don't add it to config.php +if ( ! Kohana::config('config.allowed_iframe_regexp') ) +{ + Kohana::config_set('config.allowed_iframe_regexp', '%^http://(www.youtube.com/embed/|player.vimeo.com/video/|w.soundcloud.com/player)%'); +} +