Skip to content

Commit 28e14bf

Browse files
committed
support for tumblr redirections
1 parent 5915ec4 commit 28e14bf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Http/Redirects.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ abstract class Redirects
1212
'googleTranslator' => 'translate.google.com/translate',
1313
'hashBang' => '*#!*',
1414
'spotify' => 'play.spotify.com/*',
15+
'tumblr' => 't.umblr.com/redirect',
1516
];
1617

1718
/**
@@ -91,4 +92,20 @@ public static function spotify(Url $url)
9192
{
9293
return $url->withHost('open.spotify.com');
9394
}
95+
96+
/**
97+
* Redirect the tumblr url
98+
*
99+
* @param Url $url
100+
*
101+
* @return Url
102+
*/
103+
public static function tumblr(Url $url)
104+
{
105+
if (($value = $url->getQueryParameter('z'))) {
106+
return Url::create($value);
107+
}
108+
109+
return $url;
110+
}
94111
}

0 commit comments

Comments
 (0)