From 1068f313039c69fc9b57e17cc82403689476a616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 11:57:18 +0200 Subject: [PATCH] [BastaBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/BastaBridge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php index e91f9fa8..a7a7c829 100644 --- a/bridges/BastaBridge.php +++ b/bridges/BastaBridge.php @@ -8,10 +8,11 @@ class BastaBridge extends BridgeAbstract{ public function collectData(){ // Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'! function ReplaceImageUrl($content){ - return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\'http://www.bastamag.net/$1\'', $content); + return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.$this->uri.'$1\'', $content); } - $html = $this->getSimpleHTMLDOM('http://www.bastamag.net/spip.php?page=backend') or $this->returnServerError('Could not request Bastamag.'); + $html = $this->getSimpleHTMLDOM($this->uri.'spip.php?page=backend') + or $this->returnServerError('Could not request Bastamag.'); $limit = 0; foreach($html->find('item') as $element) {