mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-23 16:43:11 +02:00
bridges: add context to detectParameters (#3607)
* bridges: add context to detectParameters Some bridges did not return the context parameter but they used it in the parameters * bridges: add context to detectParameters Fix test for InstagramBridge
This commit is contained in:
@@ -88,6 +88,7 @@ class FacebookBridge extends BridgeAbstract
|
||||
// By profile
|
||||
$regex = '/^(https?:\/\/)?(www\.)?facebook\.com\/profile\.php\?id\=([^\/?&\n]+)?(.*)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'User';
|
||||
$params['u'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
@@ -95,6 +96,7 @@ class FacebookBridge extends BridgeAbstract
|
||||
// By group
|
||||
$regex = '/^(https?:\/\/)?(www\.)?facebook\.com\/groups\/([^\/?\n]+)?(.*)/';
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Group';
|
||||
$params['g'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
@@ -103,6 +105,7 @@ class FacebookBridge extends BridgeAbstract
|
||||
$regex = '/^(https?:\/\/)?(www\.)?facebook\.com\/([^\/?\n]+)/';
|
||||
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = '';
|
||||
$params['u'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
|
Reference in New Issue
Block a user