mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 01:25:21 +02:00
[ReporterreBridge + KernelBugTrackerBridge + BastaBridge] Use defaultLinkTo() (#1862)
This commit is contained in:
parent
0755181555
commit
1e75f9d3d5
3 changed files with 9 additions and 26 deletions
|
@ -61,6 +61,8 @@ class KernelBugTrackerBridge extends BridgeAbstract {
|
|||
if($html === false)
|
||||
returnServerError('Failed to load page!');
|
||||
|
||||
$html = defaultLinkTo($html, self::URI);
|
||||
|
||||
// Store header information into private members
|
||||
$this->bugid = $html->find('#bugzilla-body', 0)->find('a', 0)->innertext;
|
||||
$this->bugdesc = $html->find('table.bugfields', 0)->find('tr', 0)->find('td', 0)->innertext;
|
||||
|
@ -93,7 +95,7 @@ class KernelBugTrackerBridge extends BridgeAbstract {
|
|||
$item['content'] = str_replace("\n", '<br>', $item['content']);
|
||||
|
||||
// Fix relative URIs
|
||||
$item['content'] = $this->replaceRelativeURI($item['content']);
|
||||
$item['content'] = $item['content'];
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
@ -125,17 +127,6 @@ class KernelBugTrackerBridge extends BridgeAbstract {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces all relative URIs with absolute ones
|
||||
*
|
||||
* @param string $content The source string
|
||||
* @return string Returns the source string with all relative URIs replaced
|
||||
* by absolute ones.
|
||||
*/
|
||||
private function replaceRelativeURI($content){
|
||||
return preg_replace('/href="(?!http)/', 'href="' . self::URI . '/', $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds styles as attributes to tags with known classes
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue