diff --git a/composer.json b/composer.json index d0d6ee2..a8a8668 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "fguillot/simple-validator": "v0.0.3", "fguillot/json-rpc": "v0.0.3", "fguillot/picodb": "v0.0.3", - "fguillot/picofeed": "v0.1.6", + "fguillot/picofeed": "v0.1.7", "fguillot/picofarad": "dev-master" }, "autoload": { diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 70d78bc..5e1469e 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -54,6 +54,8 @@ class ClassLoader private $useIncludePath = false; private $classMap = array(); + private $classMapAuthoritative = false; + public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -248,6 +250,27 @@ class ClassLoader return $this->useIncludePath; } + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + /** * Registers this instance as an autoloader. * @@ -299,6 +322,9 @@ class ClassLoader if (isset($this->classMap[$class])) { return $this->classMap[$class]; } + if ($this->classMapAuthoritative) { + return false; + } $file = $this->findFileWithExtension($class, '.php'); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 22a6724..576f3f1 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -156,17 +156,17 @@ }, { "name": "fguillot/picofeed", - "version": "v0.1.6", - "version_normalized": "0.1.6.0", + "version": "v0.1.7", + "version_normalized": "0.1.7.0", "source": { "type": "git", "url": "https://github.com/fguillot/picoFeed.git", - "reference": "1e89a3fd579cf3d83cc65c09047f92f81ce6a923" + "reference": "8ed3f1a9f777938611645d523ddc707a7cd0e7d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/1e89a3fd579cf3d83cc65c09047f92f81ce6a923", - "reference": "1e89a3fd579cf3d83cc65c09047f92f81ce6a923", + "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/8ed3f1a9f777938611645d523ddc707a7cd0e7d7", + "reference": "8ed3f1a9f777938611645d523ddc707a7cd0e7d7", "shasum": "" }, "require": { @@ -180,7 +180,7 @@ "suggest": { "ext-curl": "PicoFeed will use cURL if present" }, - "time": "2015-07-12 23:33:40", + "time": "2015-08-02 17:56:46", "bin": [ "picofeed" ], diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php index 0c609db..3e408b6 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php @@ -243,8 +243,7 @@ class Curl extends Client curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout); curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($ch, CURLOPT_HTTPHEADER, $this->prepareHeaders()); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ini_get('open_basedir') === ''); - curl_setopt($ch, CURLOPT_MAXREDIRS, $this->max_redirects); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_COOKIEJAR, 'php://memory'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'php://memory'); @@ -310,8 +309,7 @@ class Curl extends Client list($status, $headers) = HttpHeaders::parse(explode("\n", $this->response_headers[$this->response_headers_count - 1])); - // When restricted with open_basedir - if ($this->needToHandleRedirection($follow_location, $status)) { + if ($follow_location && ($status == 301 || $status == 302)) { return $this->handleRedirection($headers['Location']); } @@ -322,19 +320,6 @@ class Curl extends Client ); } - /** - * Check if the redirection have to be handled manually - * - * @access private - * @param boolean $follow_location Flag - * @param integer $status HTTP status code - * @return boolean - */ - private function needToHandleRedirection($follow_location, $status) - { - return $follow_location && ini_get('open_basedir') !== '' && ($status == 301 || $status == 302); - } - /** * Handle manually redirections when there is an open base dir restriction * diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Url.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Url.php index f03305c..396a108 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Url.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Url.php @@ -148,6 +148,24 @@ class Url return empty($path) || $path{0} !== '/'; } + /** + * Filters the path of a URI + * + * Imported from Guzzle library: https://github.com/guzzle/psr7/blob/master/src/Uri.php#L568-L582 + * + * @access public + * @param $path + * @return string + */ + public function filterPath($path, $charUnreserved = 'a-zA-Z0-9_\-\.~', $charSubDelims = '!\$&\'\(\)\*\+,;=') + { + return preg_replace_callback( + '/(?:[^' . $charUnreserved . $charSubDelims . ':@\/%]+|%(?![A-Fa-f0-9]{2}))/', + function (array $matches) { return rawurlencode($matches[0]); }, + $path + ); + } + /** * Get the path * @@ -156,7 +174,7 @@ class Url */ public function getPath() { - return empty($this->components['path']) ? '' : $this->components['path']; + return $this->filterPath(empty($this->components['path']) ? '' : $this->components['path']); } /** diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php index ec1dac4..1c5842d 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php @@ -149,6 +149,7 @@ class Attribute 'feeds.feedburner.com', 'share.feedsportal.com', 'da.feedsportal.com', + 'rc.feedsportal.com', 'rss.feedsportal.com', 'res.feedsportal.com', 'res1.feedsportal.com', diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.lesnumeriques.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.lesnumeriques.com.php new file mode 100644 index 0000000..8fe6299 --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.lesnumeriques.com.php @@ -0,0 +1,25 @@ + array( + '%.*%' => array( + 'test_url' => 'http://www.lesnumeriques.com/blender/kitchenaid-diamond-5ksb1585-p27473/test.html', + 'body' => array( + '//*[@id="product-content"]', + '//*[@id="news-content"]', + '//*[@id="article-content"]', + ), + 'strip' => array( + '//form', + '//div[contains(@class, "price-v4"])', + '//div[contains(@class, "authors-and-date")]', + '//div[contains(@class, "mini-product")]', + '//div[@id="articles-related-authors"]', + '//div[@id="tags-socials"]', + '//div[@id="user-reviews"]', + '//div[@id="product-reviews"]', + '//div[@id="publication-breadcrumbs-and-date"]', + '//div[@id="publication-breadcrumbs-and-date"]', + ) + ) + ) +); \ No newline at end of file diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php index 69d6a21..32b45e7 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php @@ -179,7 +179,7 @@ class Rss20 extends Writer { $xml->appendChild($this->dom->createElement( 'pubDate', - date(DATE_RFC822, $value ?: time()) + date(DATE_RSS, $value ?: time()) )); } diff --git a/vendor/fguillot/picofeed/tests/Client/ClientTest.php b/vendor/fguillot/picofeed/tests/Client/ClientTest.php index b508372..4099a71 100644 --- a/vendor/fguillot/picofeed/tests/Client/ClientTest.php +++ b/vendor/fguillot/picofeed/tests/Client/ClientTest.php @@ -28,7 +28,7 @@ class ClientTest extends PHPUnit_Framework_TestCase public function testPassthrough() { $client = Client::getInstance(); - $client->setUrl('http://miniflux.net/favicon.ico'); + $client->setUrl('https://miniflux.net/favicon.ico'); $client->enablePassthroughMode(); $client->execute(); diff --git a/vendor/fguillot/picofeed/tests/Client/CurlTest.php b/vendor/fguillot/picofeed/tests/Client/CurlTest.php index 3ee249f..a1410ce 100644 --- a/vendor/fguillot/picofeed/tests/Client/CurlTest.php +++ b/vendor/fguillot/picofeed/tests/Client/CurlTest.php @@ -28,7 +28,7 @@ class CurlTest extends PHPUnit_Framework_TestCase public function testPassthrough() { $client = new Curl; - $client->setUrl('http://miniflux.net/favicon.ico'); + $client->setUrl('https://miniflux.net/favicon.ico'); $client->enablePassthroughMode(); $client->doRequest(); diff --git a/vendor/fguillot/picofeed/tests/Client/UrlTest.php b/vendor/fguillot/picofeed/tests/Client/UrlTest.php index f55d301..e74e0c7 100644 --- a/vendor/fguillot/picofeed/tests/Client/UrlTest.php +++ b/vendor/fguillot/picofeed/tests/Client/UrlTest.php @@ -288,5 +288,11 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO '', Url::resolve('', '') ); + + // Test no-ascii paths + $this->assertEquals( + 'http://lesjoiesducode.fr/post/125336534020/quand-la-page-doit-%C3%AAtre-pixel-perfect', + Url::resolve('http://lesjoiesducode.fr/post/125336534020/quand-la-page-doit-ĂȘtre-pixel-perfect', 'http://lesjoiesducode.fr/post/125336534020') + ); } } diff --git a/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php b/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php index 2c61b85..8a7f945 100644 --- a/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php +++ b/vendor/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php @@ -50,7 +50,7 @@ class Rss20WriterTest extends PHPUnit_Framework_TestCase PicoFeed (https://github.com/fguillot/picoFeed) My site My site - '.date(DATE_RFC822).' + '.date(DATE_RSS).' http://boo/ me@here (Me) @@ -58,7 +58,7 @@ class Rss20WriterTest extends PHPUnit_Framework_TestCase My article 1 http://foo/bar http://foo/bar - '.date(DATE_RFC822, strtotime('-2 days')).' + '.date(DATE_RSS, strtotime('-2 days')).' Super summary content

]]>
@@ -66,7 +66,7 @@ class Rss20WriterTest extends PHPUnit_Framework_TestCase My article 2 http://foo/bar2 http://foo/bar2 - '.date(DATE_RFC822, strtotime('-1 day')).' + '.date(DATE_RSS, strtotime('-1 day')).' Super summary 2 content 2   © 2015

]]>
@@ -74,7 +74,7 @@ class Rss20WriterTest extends PHPUnit_Framework_TestCase My article 3 http://foo/bar3 http://foo/bar3 - '.date(DATE_RFC822).' + '.date(DATE_RSS).' @@ -82,4 +82,4 @@ class Rss20WriterTest extends PHPUnit_Framework_TestCase $this->assertEquals($expected_output, $generated_output); } -} \ No newline at end of file +}