Try to guess CDN the protocol if it is set to NULL in config

This commit is contained in:
Celestora 2022-04-18 19:42:05 +03:00
parent 2c10659003
commit 3d24c1c881

View file

@ -66,7 +66,7 @@ abstract class Media extends Postable
case "server": case "server":
$settings = (object) OPENVK_ROOT_CONF["openvk"]["preferences"]["uploads"]["server"]; $settings = (object) OPENVK_ROOT_CONF["openvk"]["preferences"]["uploads"]["server"];
return ( return (
$settings->protocol . $settings->protocol ?? ovk_scheme() .
"://" . $settings->host . "://" . $settings->host .
$settings->path . $settings->path .
substr($hash, 0, 2) . "/$hash.$this->fileExtension" substr($hash, 0, 2) . "/$hash.$this->fileExtension"