mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 22:28:22 +01:00
[UrlebirdBridge] Fix for non ASCII characters in post URI (#2312)
This commit is contained in:
parent
4187d8f4cf
commit
0ba0e2de4e
@ -19,6 +19,12 @@ class UrlebirdBridge extends BridgeAbstract {
|
||||
|
||||
private $title;
|
||||
|
||||
private function fixURI($uri) {
|
||||
$path = parse_url($uri, PHP_URL_PATH);
|
||||
$encoded_path = array_map('urlencode', explode('/', $path));
|
||||
return str_replace($path, implode('/', $encoded_path), $uri);
|
||||
}
|
||||
|
||||
public function collectData() {
|
||||
switch($this->getInput('query')[0]) {
|
||||
default:
|
||||
@ -37,7 +43,7 @@ class UrlebirdBridge extends BridgeAbstract {
|
||||
$articles = $html->find('div.thumb');
|
||||
foreach ($articles as $article) {
|
||||
$item = array();
|
||||
$item['uri'] = $article->find('a', 2)->href;
|
||||
$item['uri'] = $this->fixURI($article->find('a', 2)->href);
|
||||
$article_content = getSimpleHTMLDOM($item['uri']);
|
||||
$item['author'] = $article->find('img', 0)->alt . ' (' .
|
||||
$article_content->find('a.user-video', 1)->innertext . ')';
|
||||
@ -48,7 +54,9 @@ class UrlebirdBridge extends BridgeAbstract {
|
||||
$item['content'] = $video->outertext . '<br>' .
|
||||
$article_content->find('div.music', 0) . '<br>' .
|
||||
$article_content->find('div.info2', 0)->innertext .
|
||||
'<br><br><a href="' . $article_content->find('video', 0)->src . '">Video link</a>';
|
||||
'<br><br><a href="' . $article_content->find('video', 0)->src .
|
||||
'">Direct video link</a><br><br><a href="' . $item['uri'] .
|
||||
'">Post link</a><br><br>';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user