[DanbooruBridge] Fix broken URI
This fixes broken URIs in the output data caused by duplicate domain names caused by sites (descendant class Delbooru) providing absolute URIs instead of relative ones. References #552
This commit is contained in:
parent
1faa91ef0f
commit
f6f3a213ef
1 changed files with 5 additions and 2 deletions
|
@ -31,11 +31,14 @@ class DanbooruBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
protected function getItemFromElement($element){
|
||||
// Fix links
|
||||
defaultLinkTo($element, $this->getURI());
|
||||
|
||||
$item = array();
|
||||
$item['uri'] = $this->getURI() . $element->find('a', 0)->href;
|
||||
$item['uri'] = $element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/", '', $element->getAttribute(static::IDATTRIBUTE));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $this->getURI() . $element->find('img', 0)->src;
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = $this->getName() . ' | ' . $item['postid'];
|
||||
$item['content'] = '<a href="'
|
||||
|
|
Loading…
Reference in a new issue