mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-21 07:42:10 +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:
@@ -63,9 +63,9 @@ class InstagramBridge extends BridgeAbstract
|
||||
];
|
||||
|
||||
const TEST_DETECT_PARAMETERS = [
|
||||
'https://www.instagram.com/metaverse' => ['u' => 'metaverse'],
|
||||
'https://instagram.com/metaverse' => ['u' => 'metaverse'],
|
||||
'http://www.instagram.com/metaverse' => ['u' => 'metaverse'],
|
||||
'https://www.instagram.com/metaverse' => ['context' => 'Username', 'u' => 'metaverse'],
|
||||
'https://instagram.com/metaverse' => ['context' => 'Username', 'u' => 'metaverse'],
|
||||
'http://www.instagram.com/metaverse' => ['context' => 'Username', 'u' => 'metaverse'],
|
||||
];
|
||||
|
||||
const USER_QUERY_HASH = '58b6785bea111c67129decbe6a448951';
|
||||
@@ -323,6 +323,7 @@ class InstagramBridge extends BridgeAbstract
|
||||
$regex = '/^(https?:\/\/)?(www\.)?instagram\.com\/([^\/?\n]+)/';
|
||||
|
||||
if (preg_match($regex, $url, $matches) > 0) {
|
||||
$params['context'] = 'Username';
|
||||
$params['u'] = urldecode($matches[3]);
|
||||
return $params;
|
||||
}
|
||||
|
Reference in New Issue
Block a user