Skip to content

Commit 4f79002

Browse files
committed
removed contains and remove proxify from magnet: links
1 parent ca6cd4d commit 4f79002

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/Plugin/ProxifyPlugin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ private function css_import($matches){
3232

3333
private function html_href($matches){
3434

35-
$url = $matches[2];
35+
$url = trim($matches[2]);
36+
37+
// do not proxify magnet: links
38+
if(strpos($url, "magnet") === 0){
39+
return $matches[0];
40+
}
3641

3742
// do we even need to proxify this URL?
3843
return str_replace($url, proxify_url($url, $this->base_url), $matches[0]);

src/helpers.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ function is_html($content_type){
1111
return clean_content_type($content_type) == 'text/html';
1212
}
1313

14-
function contains($haystack, $needle){
15-
return strpos($haystack, $needle) !== false;
16-
}
17-
1814
function in_arrayi($needle, $haystack){
1915
return in_array(strtolower($needle), array_map('strtolower', $haystack));
2016
}

0 commit comments

Comments
 (0)