mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-09-12 06:12:08 +00:00
fix encoding
This commit is contained in:
parent
4c041ffb03
commit
8cc40b849c
@ -428,15 +428,8 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||||||
$response->message = _('Link required');
|
$response->message = _('Link required');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate base64
|
|
||||||
else if (!$link = (string) @base64_decode($_GET['magnet']))
|
|
||||||
{
|
|
||||||
$response->success = false;
|
|
||||||
$response->message = _('Invalid link encoding');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate magnet
|
// Validate magnet
|
||||||
else if (!$magnet = Yggverse\Parser\Magnet::parse($link))
|
else if (!$magnet = Yggverse\Parser\Magnet::parse($_GET['magnet']))
|
||||||
{
|
{
|
||||||
$response->success = false;
|
$response->success = false;
|
||||||
$response->message = _('Invalid magnet link');
|
$response->message = _('Invalid magnet link');
|
||||||
@ -454,7 +447,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||||||
if ($magnetId = $db->addMagnet( $user->userId,
|
if ($magnetId = $db->addMagnet( $user->userId,
|
||||||
$magnet->xl,
|
$magnet->xl,
|
||||||
$magnet->dn,
|
$magnet->dn,
|
||||||
$link,
|
'', // @TODO deprecated, remove
|
||||||
MAGNET_DEFAULT_PUBLIC,
|
MAGNET_DEFAULT_PUBLIC,
|
||||||
MAGNET_DEFAULT_COMMENTS,
|
MAGNET_DEFAULT_COMMENTS,
|
||||||
MAGNET_DEFAULT_SENSITIVE,
|
MAGNET_DEFAULT_SENSITIVE,
|
||||||
|
@ -58,7 +58,7 @@ else
|
|||||||
if ($magnet = Yggverse\Parser\Magnet::is($request->query))
|
if ($magnet = Yggverse\Parser\Magnet::is($request->query))
|
||||||
{
|
{
|
||||||
header(
|
header(
|
||||||
sprintf('Location: %s/action.php?target=magnet&toggle=new&magnet=%s', WEBSITE_URL, base64_encode($request->query))
|
sprintf('Location: %s/action.php?target=magnet&toggle=new&magnet=%s', WEBSITE_URL, urlencode($request->query))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user