lots of progress

This commit is contained in:
2025-03-31 23:25:59 +03:00
parent 5ef903b195
commit 7d6f72d31c
19 changed files with 1163 additions and 667 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Services;
class Utils
{
public static function proxifyUrl(string $url, string $siteBaseUrl)
{
if (!self::isNotAbsoluteUrl($url)) {
// should append site url
$url = $siteBaseUrl.$url;
}
return route('proxy.browse') . '?url=' . base64_encode($url);
}
public static function isNotAbsoluteUrl($url) {
return parse_url($url, PHP_URL_SCHEME) !== null;
}
public static function isAbsoluteUrl($url) {
return parse_url($url, PHP_URL_SCHEME) === null;
}
}