summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-09-30 21:18:27 +0200
committerRobin Appelman <icewind@owncloud.com>2013-09-30 21:18:27 +0200
commit2e128befdac4ee892d82e09fc6c299ec6e8aad29 (patch)
treeb39f36b5ce98455050f9fc151e6bc32f7b10536a
parent5e7ddcb4e747ff9b1a8daed1a0e00d66616503e3 (diff)
set the useragent when getting the full body for the xpath enhancer
-rw-r--r--articleenhancer/xpatharticleenhancer.php4
-rw-r--r--utility/simplepiefilefactory.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php
index 77a16f04d..93ceaf896 100644
--- a/articleenhancer/xpatharticleenhancer.php
+++ b/articleenhancer/xpatharticleenhancer.php
@@ -61,7 +61,7 @@ class XPathArticleEnhancer implements ArticleEnhancer {
foreach($this->regexXPathPair as $regex => $search) {
if(preg_match($regex, $item->getUrl())) {
- $file = $this->fileFactory->getFile($item->getUrl(), $this->maximumTimeout);
+ $file = $this->fileFactory->getFile($item->getUrl(), $this->maximumTimeout, "Mozilla/5.0 AppleWebKit");
// convert encoding by detecting charset from header
$contentType = $file->headers['content-type'];
@@ -215,4 +215,4 @@ class XPathArticleEnhancer implements ArticleEnhancer {
}
-} \ No newline at end of file
+}
diff --git a/utility/simplepiefilefactory.php b/utility/simplepiefilefactory.php
index 13b56dc9e..5f1867c38 100644
--- a/utility/simplepiefilefactory.php
+++ b/utility/simplepiefilefactory.php
@@ -28,8 +28,8 @@ namespace OCA\News\Utility;
class SimplePieFileFactory {
- public function getFile($url, $timeout) {
- return new \SimplePie_File($url, $timeout);
+ public function getFile($url, $timeout, $userAgent = null) {
+ return new \SimplePie_File($url, $timeout, null, null, $userAgent);
}
-} \ No newline at end of file
+}