summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-04-15 11:23:49 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-04-15 11:23:49 +0200
commit99f1aedd70a37b8763f0d72e0db223ede62190f3 (patch)
tree0264b9ed0ed633ba26a990e8ce9254bf04e1f456 /vendor
parent53eccb2ff78f6d94355cfca3cbfefc981e5de03b (diff)
remove youtube autoplay in picofeed
Diffstat (limited to 'vendor')
-rw-r--r--vendor/composer/installed.json10
-rw-r--r--vendor/fguillot/picofeed/LICENSE21
-rw-r--r--vendor/fguillot/picofeed/README.markdown2
-rw-r--r--vendor/fguillot/picofeed/UNLICENSE24
-rw-r--r--vendor/fguillot/picofeed/composer.json2
-rw-r--r--vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php20
-rw-r--r--vendor/fguillot/picofeed/lib/PicoFeed/Rules/vuxml.org.php13
-rw-r--r--vendor/fguillot/picofeed/tests/Filter/AttributeFilterTest.php18
8 files changed, 79 insertions, 31 deletions
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index fa2c89fda..ccd9bea2b 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -119,12 +119,12 @@
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
- "reference": "273c344b35b468b6c8053f635332c3a404f8c7b9"
+ "reference": "6ac3334f272478257d3e4486164bc4e84046f784"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/273c344b35b468b6c8053f635332c3a404f8c7b9",
- "reference": "273c344b35b468b6c8053f635332c3a404f8c7b9",
+ "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/6ac3334f272478257d3e4486164bc4e84046f784",
+ "reference": "6ac3334f272478257d3e4486164bc4e84046f784",
"shasum": ""
},
"require": {
@@ -138,7 +138,7 @@
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
- "time": "2015-04-11 12:46:50",
+ "time": "2015-04-15 00:10:14",
"bin": [
"picofeed"
],
@@ -151,7 +151,7 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "Unlicense"
+ "MIT"
],
"authors": [
{
diff --git a/vendor/fguillot/picofeed/LICENSE b/vendor/fguillot/picofeed/LICENSE
new file mode 100644
index 000000000..6a362bc16
--- /dev/null
+++ b/vendor/fguillot/picofeed/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Frederic Guillot
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/fguillot/picofeed/README.markdown b/vendor/fguillot/picofeed/README.markdown
index 4a958c24c..957dc3a1b 100644
--- a/vendor/fguillot/picofeed/README.markdown
+++ b/vendor/fguillot/picofeed/README.markdown
@@ -24,7 +24,7 @@ Features
- Content grabber: download from the original website the full content
- Enclosure detection
- RTL languages support
-- License: Unlicense <http://unlicense.org/>
+- License: MIT
Requirements
------------
diff --git a/vendor/fguillot/picofeed/UNLICENSE b/vendor/fguillot/picofeed/UNLICENSE
deleted file mode 100644
index 68a49daad..000000000
--- a/vendor/fguillot/picofeed/UNLICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
diff --git a/vendor/fguillot/picofeed/composer.json b/vendor/fguillot/picofeed/composer.json
index 4c13bd6ab..56a5ee27e 100644
--- a/vendor/fguillot/picofeed/composer.json
+++ b/vendor/fguillot/picofeed/composer.json
@@ -3,7 +3,7 @@
"description": "Modern library to write or read feeds (RSS/Atom)",
"homepage": "http://fguillot.github.io/picoFeed",
"type": "library",
- "license": "Unlicense",
+ "license": "MIT",
"authors": [
{
"name": "Frédéric Guillot",
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php
index ae77ff714..ec1dac417 100644
--- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php
@@ -235,6 +235,7 @@ class Attribute
'filterProtocolUrlAttribute',
'rewriteImageProxyUrl',
'secureIframeSrc',
+ 'removeYouTubeAutoplay'
);
/**
@@ -405,6 +406,25 @@ class Attribute
}
/**
+ * Removes YouTube autoplay from iframes
+ *
+ * @access public
+ * @param string $tag Tag name
+ * @param array $attribute Atttributes name
+ * @param string $value Attribute value
+ * @return boolean
+ */
+ public function removeYouTubeAutoplay($tag, $attribute, &$value)
+ {
+ $regex = '%^(https://(?:www\.)?youtube.com/.*\?.*autoplay=)(1)(.*)%i';
+ if ($tag === 'iframe' && $attribute === 'src' && preg_match($regex, $value)) {
+ $value = preg_replace($regex, '${1}0$3', $value);
+ }
+
+ return true;
+ }
+
+ /**
* Rewrite image url to use with a proxy
*
* @access public
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/vuxml.org.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/vuxml.org.php
new file mode 100644
index 000000000..dd433828b
--- /dev/null
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/vuxml.org.php
@@ -0,0 +1,13 @@
+<?php
+return array(
+ 'test_url' => 'http://www.vuxml.org/freebsd/a5f160fa-deee-11e4-99f8-080027ef73ec.html',
+ 'body' => array(
+ '//body'
+ ),
+ 'strip' => array(
+ '//h1',
+ '//div[@class="blurb"]',
+ '//hr',
+ '//p[@class="copyright"]'
+ )
+); \ No newline at end of file
diff --git a/vendor/fguillot/picofeed/tests/Filter/AttributeFilterTest.php b/vendor/fguillot/picofeed/tests/Filter/AttributeFilterTest.php
index bf7dd224e..5dcfda141 100644
--- a/vendor/fguillot/picofeed/tests/Filter/AttributeFilterTest.php
+++ b/vendor/fguillot/picofeed/tests/Filter/AttributeFilterTest.php
@@ -128,6 +128,24 @@ class AttributeFilterTest extends PHPUnit_Framework_TestCase
$this->assertEquals(array('src' => 'https://www.youtube.com/test'), $filter->filter('iframe', array('src' => '//www.youtube.com/test')));
}
+ public function testRemoveYouTubeAutoplay()
+ {
+ $filter = new Attribute(new Url('http://google.com'));
+ $urls = array(
+ 'https://www.youtube.com/something/?autoplay=1' => 'https://www.youtube.com/something/?autoplay=0',
+ 'https://www.youtube.com/something/?test=s&autoplay=1&a=2' => 'https://www.youtube.com/something/?test=s&autoplay=0&a=2',
+ 'https://www.youtube.com/something/?test=s' => 'https://www.youtube.com/something/?test=s',
+ 'https://youtube.com/something/?autoplay=1' => 'https://youtube.com/something/?autoplay=0',
+ 'https://youtube.com/something/?test=s&autoplay=1&a=2' => 'https://youtube.com/something/?test=s&autoplay=0&a=2',
+ 'https://youtube.com/something/?test=s' => 'https://youtube.com/something/?test=s',
+ );
+
+ foreach ($urls as $before => $after) {
+ $filter->removeYouTubeAutoplay('iframe', 'src', $before);
+ $this->assertEquals($after, $before);
+ }
+ }
+
public function testFilterBlacklistAttribute()
{
$filter = new Attribute(new Url('http://google.com'));