summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-02 20:01:35 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-02 20:01:35 +0200
commitf29881d554a0cbda997d8dcb12b7c0fd1e59be14 (patch)
tree08c001fba426dacf24ccff51148a250fbf8e054a
parent5ae697ac9dbaf999d51fa7805078249f33c301dc (diff)
force links to open in new tabs, fix #146
-rw-r--r--controller/foldercontroller.php3
-rw-r--r--tests/unit/controller/FolderControllerTest.php2
-rw-r--r--tests/unit/utility/FeedFetcherTest.php5
-rw-r--r--utility/feedfetcher.php3
4 files changed, 8 insertions, 5 deletions
diff --git a/controller/foldercontroller.php b/controller/foldercontroller.php
index f8d99410d..a2e0d028b 100644
--- a/controller/foldercontroller.php
+++ b/controller/foldercontroller.php
@@ -65,6 +65,7 @@ class FolderController extends Controller {
$this->folderBusinessLayer->open($folderId, $isOpened, $userId);
}
+
/**
* @IsAdminExemption
* @IsSubAdminExemption
@@ -113,7 +114,6 @@ class FolderController extends Controller {
return $this->renderJSON($params);
} catch (BusinessLayerException $ex){
-
return $this->renderJSON(array(), $ex->getMessage());
}
@@ -157,7 +157,6 @@ class FolderController extends Controller {
return $this->renderJSON($params);
} catch (BusinessLayerException $ex){
-
return $this->renderJSON(array(), $ex->getMessage());
}
}
diff --git a/tests/unit/controller/FolderControllerTest.php b/tests/unit/controller/FolderControllerTest.php
index 4b070a0bb..67529edbc 100644
--- a/tests/unit/controller/FolderControllerTest.php
+++ b/tests/unit/controller/FolderControllerTest.php
@@ -323,4 +323,6 @@ class FolderControllerTest extends ControllerTestUtility {
$this->assertEquals($msg, $params['msg']);
$this->assertTrue($response instanceof JSONResponse);
}
+
+
} \ No newline at end of file
diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php
index 3794eb1da..9ddd9d593 100644
--- a/tests/unit/utility/FeedFetcherTest.php
+++ b/tests/unit/utility/FeedFetcherTest.php
@@ -100,7 +100,8 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
$this->permalink = 'http://permalink';
$this->title = 'my title&lt;';
$this->guid = 'hey guid here';
- $this->body = 'let the bodies hit the floor';
+ $this->body = 'let the bodies hit the floor <a href="test">test</a>';
+ $this->body2 = 'let the bodies hit the floor <a target="_blank" href="test">test</a>';
$this->pub = 23111;
$this->author = '&lt;boogieman';
$this->enclosureLink = 'http://enclosure.you';
@@ -177,7 +178,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
$item->setTitle(html_entity_decode($this->title));
$item->setGuid($this->guid);
$item->setGuidHash(md5($this->guid));
- $item->setBody($this->body);
+ $item->setBody($this->body2);
$item->setPubDate($this->pub);
$item->setLastModified($this->time);
if($author) {
diff --git a/utility/feedfetcher.php b/utility/feedfetcher.php
index a8964db3b..e153669ac 100644
--- a/utility/feedfetcher.php
+++ b/utility/feedfetcher.php
@@ -115,7 +115,8 @@ class FeedFetcher implements IFeedFetcher {
$guid = $simplePieItem->get_id();
$item->setGuid($guid);
$item->setGuidHash(md5($guid));
- $item->setBody($simplePieItem->get_content());
+ $item->setBody(str_replace('<a', '<a target="_blank"',
+ $simplePieItem->get_content()));
$item->setPubDate($simplePieItem->get_date('U'));
$item->setLastModified($this->time->getTime());