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
|
public static function getAffiliateLink(string $url): string
|
||||||
{
|
{
|
||||||
$urlParts = parse_url($url);
|
// Bypass the link generation entirely for Private.coffee fork
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function hasAffiliateLink(string $url): bool
|
public static function hasAffiliateLink(string $url): bool
|
||||||
{
|
{
|
||||||
$urlParts = parse_url($url);
|
// Just bypass the check entirely for Private.coffee fork
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue