From 0b9bb8cb7868f24137c5d8b85c39cc88ea877411 Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Mon, 26 May 2014 14:29:18 +0300 Subject: add dailymotion videos, issue #708 --- inc/3rdparty/site_config/custom/dailymotion.com.txt | 12 ++++++++++++ inc/poche/Poche.class.php | 11 ++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100755 inc/3rdparty/site_config/custom/dailymotion.com.txt diff --git a/inc/3rdparty/site_config/custom/dailymotion.com.txt b/inc/3rdparty/site_config/custom/dailymotion.com.txt new file mode 100755 index 00000000..0cad808f --- /dev/null +++ b/inc/3rdparty/site_config/custom/dailymotion.com.txt @@ -0,0 +1,12 @@ +title: //title +body: //iframe + +replace_string(): _ + +single_page_link: //link[@type='application/xml+oembed'] + +prune: no +tidy: no + +http://www.dailymotion.com/video/x1vk5oh_before-they-were-on-game-of-thrones_people diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 1b69cd61..37cf66a3 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -1142,11 +1142,12 @@ class Poche * return new purifier object with actual config */ protected function getPurifier() { - $config = HTMLPurifier_Config::createDefault(); - $config->set('Cache.SerializerPath', CACHE); - $config->set('HTML.SafeIframe', true); - $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo$purifier = new HTMLPurifier($config); - + $config = HTMLPurifier_Config::createDefault(); + $config->set('Cache.SerializerPath', CACHE); + $config->set('HTML.SafeIframe', true); + //allow YouTube, Vimeo and dailymotion videos + $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/|www\.dailymotion\.com/embed/video/)%'); + return new HTMLPurifier($config); } -- cgit v1.2.3