Implemented gist and pastebin loaders
This commit is contained in:
1 parent
c378d62ccb
commit
79bc0a92d9
2 files changed
+15
No files matched your search
@@ -9,5 +9,15 @@ class PastebinLoader implements LoaderInterface
|
||||
if (!preg_match('/^pastebin\:/i', $fix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$pasteId = substr($fix, 9);
|
||||
|
||||
$url = "https://pastebin.com/raw/{$pasteId}";
|
||||
$body = file_get_contents($url);
|
||||
|
||||
$body = str_replace("\r\n", "\n", $body);
|
||||
|
||||
return $body;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user