From 53679811da855acf9bd944a389a48399ca5d5a15 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 10 Aug 2015 20:20:30 +0200 Subject: serverside full text remove enhancers add full text client side implementation fix bugs and tests for full text feed --- articleenhancer/regexarticleenhancer.php | 46 -------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 articleenhancer/regexarticleenhancer.php (limited to 'articleenhancer/regexarticleenhancer.php') diff --git a/articleenhancer/regexarticleenhancer.php b/articleenhancer/regexarticleenhancer.php deleted file mode 100644 index 0f600468e..000000000 --- a/articleenhancer/regexarticleenhancer.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\ArticleEnhancer; - -use \OCA\News\Db\Item; - - -class RegexArticleEnhancer implements ArticleEnhancer { - - private $matchArticleUrl; - private $regexPair; - - public function __construct($matchArticleUrl, array $regexPair) { - $this->matchArticleUrl = $matchArticleUrl; - $this->regexPair = $regexPair; - } - - - /** - * @param \OCA\News\Db\Item $item - * @return \OCA\News\Db\Item enhanced item - */ - public function enhance(Item $item) { - if (preg_match($this->matchArticleUrl, $item->getUrl())) { - $body = $item->getBody(); - foreach($this->regexPair as $search => $replaceWith) { - $body = preg_replace($search, $replaceWith, $body); - } - $item->setBody($body); - } - return $item; - } - - -} -- cgit v1.2.3