fix: bypass affiliate logic
Removed affiliate link generation and verification logic from Wish class methods.
This commit is contained in:
parent
368c8767f0
commit
db4b1193cf
1 changed files with 2 additions and 32 deletions
|
@ -74,43 +74,13 @@ class Wish
|
|||
|
||||
public static function getAffiliateLink(string $url): string
|
||||
{
|
||||
$urlParts = parse_url($url);
|
||||
|
||||
if (isset($urlParts['query'])) {
|
||||
\parse_str($urlParts['query'], $urlParameters);
|
||||
} else {
|
||||
$urlParameters = [];
|
||||
}
|
||||
|
||||
foreach (self::$affiliates as $host => $tagId) {
|
||||
if (\str_contains($urlParts['host'], $host)) {
|
||||
$urlParameters['tag'] = $tagId;
|
||||
$urlParts['query'] = \http_build_query($urlParameters);
|
||||
$url = $urlParts['scheme'] . '://' . $urlParts['host'] . $urlParts['path'] . '?' . $urlParts['query'];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Bypass the link generation entirely for Private.coffee fork
|
||||
return $url;
|
||||
}
|
||||
|
||||
public static function hasAffiliateLink(string $url): bool
|
||||
{
|
||||
$urlParts = parse_url($url);
|
||||
|
||||
if (isset($urlParts['query'])) {
|
||||
\parse_str($urlParts['query'], $urlParameters);
|
||||
} else {
|
||||
$urlParameters = [];
|
||||
}
|
||||
|
||||
foreach (self::$affiliates as $host => $tagId) {
|
||||
if (\str_contains($urlParts['host'], $host) && isset($urlParameters['tag'])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Just bypass the check entirely for Private.coffee fork
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue