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:
sysadminstory 2023-08-09 22:40:24 +02:00 committed by GitHub
parent 6cc4cf24dc
commit 52d3cce59d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 115 additions and 80 deletions

View file

@ -603,6 +603,7 @@ class FurAffinityBridge extends BridgeAbstract
// Single journal
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/journal\/(\d+)/';
if (preg_match($regex, $url, $matches) > 0) {
$params['context'] = 'Single Journal';
$params['journal-id'] = urldecode($matches[3]);
return $params;
}
@ -610,6 +611,7 @@ class FurAffinityBridge extends BridgeAbstract
// Journals
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/journals\/([^\/&?\n]+)/';
if (preg_match($regex, $url, $matches) > 0) {
$params['context'] = 'Journals';
$params['username-journals'] = urldecode($matches[3]);
return $params;
}
@ -617,6 +619,7 @@ class FurAffinityBridge extends BridgeAbstract
// Gallery folder
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/gallery\/([^\/&?\n]+)\/folder\/(\d+)/';
if (preg_match($regex, $url, $matches) > 0) {
$params['context'] = 'Gallery Folder';
$params['username-folder'] = urldecode($matches[3]);
$params['folder-id'] = urldecode($matches[4]);
$params['full'] = 'on';
@ -626,6 +629,7 @@ class FurAffinityBridge extends BridgeAbstract
// Gallery (must be after gallery folder)
$regex = '/^(https?:\/\/)?(www\.)?furaffinity.net\/(gallery|scraps|favorites)\/([^\/&?\n]+)/';
if (preg_match($regex, $url, $matches) > 0) {
$params['context'] = 'Gallery';
$params['username-' . $matches[3]] = urldecode($matches[4]);
$params['full'] = 'on';
return $params;